import { Predicate } from './Predicate.js'; /** * @desc * Ensures that the `value` is not an empty string. * * @example * import { ensure, isString, TinyType } from 'tiny-types'; * * class FirstName extends TinyType { * constructor(public readonly value: string) { * ensure('FirstName', value, isNotBlank()); * } * } * * @returns {Predicate} */ export function isNotBlank(): Predicate { return Predicate.to(`not be blank`, (value: string) => typeof value === 'string' && value !== ''); }