UNPKG

io-ts-bigint

Version:
33 lines 909 B
/** * @since 0.0.1 */ import * as t from 'io-ts'; /** * @since 0.0.1 */ export interface NonEmptyStringBrand { readonly NonEmptyString: unique symbol; } /** * @since 0.0.1 */ export declare type NonEmptyString = t.Branded<string, NonEmptyStringBrand>; /** * @since 0.0.1 */ export declare type NonEmptyStringC = t.Type<NonEmptyString, string>; /** * A codec that succeeds if a string is not empty * * @example * import { NonEmptyString } from 'io-ts-bigint/lib/NonEmptyString' * import { right } from 'fp-ts/lib/Either' * import { PathReporter } from 'io-ts/lib/PathReporter' * * assert.deepStrictEqual(NonEmptyString.decode('a'), right('a')) * assert.deepStrictEqual(PathReporter.report(NonEmptyString.decode('')), ['Invalid value "" supplied to : NonEmptyString']) * * @since 0.0.1 */ export declare const NonEmptyString: NonEmptyStringC; //# sourceMappingURL=NonEmptyString.d.ts.map