精简环境变量配置

This commit is contained in:
yml2213
2026-05-26 09:48:05 +08:00
parent 8b1904d732
commit 779287f662
6 changed files with 16 additions and 63 deletions
-12
View File
@@ -9,7 +9,6 @@ import {
parseBoolean,
parseInteger,
parseJsonArray,
parseCommaSeparatedStrings,
} from "./runtime-env.js";
import { deepMerge } from "./runtime-merge.js";
@@ -305,17 +304,6 @@ function adminUsersJsonEnv(
};
}
function stringArrayEnv(
env: string,
configPath: RuntimeConfigPath
): EnvOverride {
return {
env,
path: configPath,
read: parseCommaSeparatedStrings,
};
}
function corsOriginsEnv(
env: string,
configPath: RuntimeConfigPath
-15
View File
@@ -96,18 +96,3 @@ export function parseJsonArray<T = unknown>(rawValue: unknown): T[] | null {
return null;
}
}
export function parseCommaSeparatedStrings(rawValue: unknown): string[] | null {
const normalized = String(rawValue || "").trim();
if (!normalized) {
return null;
}
const items = normalized
.split(",")
.map((item) => item.trim())
.filter((item) => item.length > 0);
return items.length > 0 ? items : null;
}