1 | /**
|
2 | * @since 0.5.13
|
3 | */
|
4 | import * as t from 'io-ts'
|
5 | /**
|
6 | * @since 0.5.13
|
7 | */
|
8 | export interface BooleanFromNumberC extends t.Type<boolean, number, unknown> {}
|
9 | /**
|
10 | * @example
|
11 | * import { BooleanFromNumber } from 'io-ts-types/lib/BooleanFromNumber'
|
12 | * import { right } from 'fp-ts/lib/Either'
|
13 | * import { PathReporter } from 'io-ts/lib/PathReporter'
|
14 | *
|
15 | * assert.deepStrictEqual(BooleanFromNumber.decode(1), right(true))
|
16 | * assert.deepStrictEqual(BooleanFromNumber.decode(0), right(false))
|
17 | * assert.deepStrictEqual(BooleanFromNumber.decode(123), right(true))
|
18 | * assert.deepStrictEqual(PathReporter.report(BooleanFromNumber.decode('a')), ['Invalid value "a" supplied to : BooleanFromNumber'])
|
19 | *
|
20 | * @since 0.5.13
|
21 | */
|
22 | export declare const BooleanFromNumber: BooleanFromNumberC
|