10 lines
302 B
TypeScript
10 lines
302 B
TypeScript
export { asOptionalRecord as asRecord } from "../../shared/record-coerce.js";
|
|
|
|
export function normalizeTrimmedString(value: unknown): string | undefined {
|
|
if (typeof value !== "string") {
|
|
return undefined;
|
|
}
|
|
const trimmed = value.trim();
|
|
return trimmed.length > 0 ? trimmed : undefined;
|
|
}
|