js.spec icon indicating copy to clipboard operation
js.spec copied to clipboard

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

Open mattbishop opened this issue 8 years ago • 0 comments

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...})

mattbishop avatar Aug 14 '17 04:08 mattbishop