Last active
March 4, 2018 12:21
-
-
Save ealush/94e4d9bca912ae4bf0a3077bb51713e3 to your computer and use it in GitHub Desktop.
naive-enforce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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