refactor: dedupe lower-parser readers

This commit is contained in:
Peter Steinberger
2026-04-07 08:23:51 +01:00
parent b3e6822ef8
commit 2197ce62bd
9 changed files with 22 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
import { normalizeOptionalString } from "../shared/string-coerce.js";
export type BooleanParseOptions = {
truthy?: string[];
falsy?: string[];
@@ -18,7 +20,7 @@ export function parseBooleanValue(
if (typeof value !== "string") {
return undefined;
}
const normalized = value.trim().toLowerCase();
const normalized = normalizeOptionalString(value)?.toLowerCase();
if (!normalized) {
return undefined;
}