UNPKG

@arthurgubaidullin/nx-embed-dependencies

Version:

This plugin for [Nx](https://nx.dev) helps injecting local dependencies into a package.

19 lines (18 loc) 610 B
/** * @since 0.4.5 */ import * as t from 'io-ts'; /** * A codec that succeeds if a string is not empty * * @example * import { NonEmptyString } from 'io-ts-types/es6/NonEmptyString' * import { right } from 'fp-ts/es6/Either' * import { PathReporter } from 'io-ts/es6/PathReporter' * * assert.deepStrictEqual(NonEmptyString.decode('a'), right('a')) * assert.deepStrictEqual(PathReporter.report(NonEmptyString.decode('')), ['Invalid value "" supplied to : NonEmptyString']) * * @since 0.4.5 */ export var NonEmptyString = t.brand(t.string, function (s) { return s.length > 0; }, 'NonEmptyString');