Skip to content

Instantly share code, notes, and snippets.

@ealush
Last active March 4, 2018 12:21
Show Gist options
  • Select an option

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

Select an option

Save ealush/94e4d9bca912ae4bf0a3077bb51713e3 to your computer and use it in GitHub Desktop.
naive-enforce
// import rules from './rules';
class Enforce {
constructor(custom = {}) {
this.rules = Object.assign({}, rules, custom);
return this.enforce;
}
enforce = (value) => {
this.value = value;
return this.rules;
}
}
const enforce = new Enforce();
enforce()
// {isArray: ƒ, largerThan: ƒ, smallerThan: ƒ, isEmpty: ƒ}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment