Skip to content

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

@mattbishop

Description

@mattbishop

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions