import { Expression, map } from "../core/index.js"; /** * Map expression values to strings except `null` or `undefined`. * * See {@link map}. * * @example * ```tsx * import { optionalString } from "rvx/convert"; * *
; //
*
; //
*
; //
* ``` */ export function optionalString(input: Expression): Expression>> { return map(input, value => { if (value === null || value === undefined) { return value; } return String(value); }) as Expression>>; }