io-ts-bigint
Version:
io-ts library for bigints
23 lines • 930 B
TypeScript
/**
* @since 0.0.1
*/
import * as t from 'io-ts';
/**
* @since 0.5.11
*/
export declare type BigIntFromStringC = t.Type<bigint, string>;
/**
* @import
* example { BigIntFromString } from 'io-ts-bigint/lib/BigIntFromString'
* import { right } from 'fp-ts/lib/Either'
* import { PathReporter } from 'io-ts/lib/PathReporter'
*
* assert.deepStrictEqual(BigIntFromString.decode('1'), right(BigInt(1)))
* assert.deepStrictEqual(PathReporter.report(BigIntFromString.decode('1.1')), ['Invalid value "1.1" supplied to : BigIntFromString'])
* assert.deepStrictEqual(PathReporter.report(BigIntFromString.decode('')), ['Invalid value "" supplied to : BigIntFromString'])
* assert.deepStrictEqual(PathReporter.report(BigIntFromString.decode(' ')), ['Invalid value " " supplied to : BigIntFromString'])
*
* @since 0.5.11
*/
export declare const BigIntFromString: BigIntFromStringC;
//# sourceMappingURL=BigIntFromString.d.ts.map