10 lines
326 B
TypeScript
10 lines
326 B
TypeScript
export function normalizeInputHostnameAllowlist(
|
|
values: string[] | undefined,
|
|
): string[] | undefined {
|
|
if (!values || values.length === 0) {
|
|
return undefined;
|
|
}
|
|
const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);
|
|
return normalized.length > 0 ? normalized : undefined;
|
|
}
|