Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for spec.or() don't match actual usage #42

Open
mattbishop opened this issue Aug 14, 2017 · 0 comments
Open

Docs for spec.or() don't match actual usage #42

mattbishop opened this issue Aug 14, 2017 · 0 comments

Comments

@mattbishop
Copy link
Contributor

The docs for "or" look like this:

or (name, ...specs) <-- Looks like you can pass in a bunch of specs like and()

Data must conform to at least one provided spec. The order in which they are validated is not defined. conform returns matched branches along with input data.

const big_or_even = spec.or("big or even", {
  'even': spec.even,
  'big': nr => nr > 1000
})```

Perhaps or should be:

or(name, {key1: spec, key2: spec...})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant