Skip to content

Instantly share code, notes, and snippets.

@Qquanwei
Created March 19, 2019 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Qquanwei/c175f94f6b8768b4e7092b9c9b055957 to your computer and use it in GitHub Desktop.
Save Qquanwei/c175f94f6b8768b4e7092b9c9b055957 to your computer and use it in GitHub Desktop.
const shouldSizeMatch = compact(
itShouldProp('width', large(20), always('width should large 20')),
itShouldProp('height', large(20), always('height should large 20'))
);
of({ width: 10, height: 30})
.map(shouldSizeMatch)
.validate((success, reason) => {
// reuse rules
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment