ts-prims
Version:
Typescript Primitives
18 lines • 471 B
JavaScript
import { lengthConstraint } from './length.js';
import { Prim } from './prim.js';
/**
* The prim type constructor function for `text`
*
* ```ts
* import { type text, Text } from 'ts-prims'
*
* // narrow using cast
* let x: text = 'Hello World!' as text
* // or using runtime check by constructor
* x = Text('Checked at runtime')
* ```
*
* @see {@link text}
*/
export const Text = Prim(`text`, String, [lengthConstraint(14)]);
//# sourceMappingURL=text.js.map