refactor: lint cleanups and helpers

This commit is contained in:
Peter Steinberger
2025-12-23 00:28:40 +00:00
parent f5837dff9c
commit 918cbdcf03
39 changed files with 679 additions and 338 deletions

View File

@@ -9,7 +9,11 @@ export function jsonError(
}
export function toStringOrEmpty(value: unknown) {
return typeof value === "string" ? value.trim() : String(value ?? "").trim();
if (typeof value === "string") return value.trim();
if (typeof value === "number" || typeof value === "boolean") {
return String(value).trim();
}
return "";
}
export function toNumber(value: unknown) {