min<T extends {}>(min: T, reason?: string): Object
min: T
reason: string = ...
import * as x from 'unhoax'// works with datesconst refineNowOrAfter = x.min(new Date(), 'now or after')const dateNowOrAfter = refineNowOrAfter(x.date)// works with numbersconst refineAsPositiveOrZero = x.min(0, 'PositiveOrZero')const positiveOrZero = refineAsPositiveZero(x.number)// or, using pipeimport pipe from 'just-pipe'const positiveOrZeroNumber = pipe( x.number, x.min(0, 'PositiveOrZero'),) // Schema<number> Copy
import * as x from 'unhoax'// works with datesconst refineNowOrAfter = x.min(new Date(), 'now or after')const dateNowOrAfter = refineNowOrAfter(x.date)// works with numbersconst refineAsPositiveOrZero = x.min(0, 'PositiveOrZero')const positiveOrZero = refineAsPositiveZero(x.number)// or, using pipeimport pipe from 'just-pipe'const positiveOrZeroNumber = pipe( x.number, x.min(0, 'PositiveOrZero'),) // Schema<number>
Example