or<B, InputB = unknown>(b: Schema<B, InputB>): Object
b: Schema<B, InputB>
union
import { x } from 'unhoax'import pipe from 'just-pipe' // or from elsewhereconst schema = pipe(x.number, x.or(x.string)) // Schema<number | string> Copy
import { x } from 'unhoax'import pipe from 'just-pipe' // or from elsewhereconst schema = pipe(x.number, x.or(x.string)) // Schema<number | string>
import { x } from 'unhoax'const orString = x.or(x.string)const schema = orString(x.number) // Schema<number | string> Copy
import { x } from 'unhoax'const orString = x.or(x.string)const schema = orString(x.number) // Schema<number | string>
See
union
Example
Example: without pipe