refactor: dedupe plugin helper readers

This commit is contained in:
Peter Steinberger
2026-04-07 06:53:30 +01:00
parent db0b91417e
commit f5c0356b37
6 changed files with 28 additions and 26 deletions

View File

@@ -1,10 +1,12 @@
import { normalizeOptionalString } from "../shared/string-coerce.js";
export function normalizePluginHttpPath(
path?: string | null,
fallback?: string | null,
): string | null {
const trimmed = path?.trim();
const trimmed = normalizeOptionalString(path);
if (!trimmed) {
const fallbackTrimmed = fallback?.trim();
const fallbackTrimmed = normalizeOptionalString(fallback);
if (!fallbackTrimmed) {
return null;
}