Skip to content

Instantly share code, notes, and snippets.

@ealush
Last active March 11, 2018 07:16
Show Gist options
  • Select an option

  • Save ealush/ab0fc9a5911ef7ef96e88407b378e3b9 to your computer and use it in GitHub Desktop.

Select an option

Save ealush/ab0fc9a5911ef7ef96e88407b378e3b9 to your computer and use it in GitHub Desktop.
enforce: rules-file-example
const rules = {
isArray: (value) => Array.isArray(value),
largerThan: (value, compare) => value > compare,
smallerThan: (value, compare) => value < compare,
isEmpty: (value) => !value || Object.keys(value).length === 0
};
// export default rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment