1 | /**
|
2 | * @since 0.4.5
|
3 | */
|
4 | import * as t from 'io-ts'
|
5 | /**
|
6 | * @since 0.4.5
|
7 | */
|
8 | export interface NonEmptyStringBrand {
|
9 | readonly NonEmptyString: unique symbol
|
10 | }
|
11 | /**
|
12 | * @since 0.4.5
|
13 | */
|
14 | export declare type NonEmptyString = t.Branded<string, NonEmptyStringBrand>
|
15 | /**
|
16 | * @since 0.4.5
|
17 | */
|
18 | export interface NonEmptyStringC extends t.Type<NonEmptyString, string, unknown> {}
|
19 | /**
|
20 | * A codec that succeeds if a string is not empty
|
21 | *
|
22 | * @example
|
23 | * import { NonEmptyString } from 'io-ts-types/lib/NonEmptyString'
|
24 | * import { right } from 'fp-ts/lib/Either'
|
25 | * import { PathReporter } from 'io-ts/lib/PathReporter'
|
26 | *
|
27 | * assert.deepStrictEqual(NonEmptyString.decode('a'), right('a'))
|
28 | * assert.deepStrictEqual(PathReporter.report(NonEmptyString.decode('')), ['Invalid value "" supplied to : NonEmptyString'])
|
29 | *
|
30 | * @since 0.4.5
|
31 | */
|
32 | export declare const NonEmptyString: NonEmptyStringC
|