MCPcopy Create free account
hub / github.com/PIKACHUIM/CFWorkerACME / normalizeDbSource

Function normalizeDbSource

src/db/index.ts:32–38  ·  view source on GitHub ↗
(value?: string)

Source from the content-addressed store, hash-verified

30
31/** 规范化 DB_SOURCE 取值 */
32export function normalizeDbSource(value?: string): DbSource {
33 const v = (value ?? "").trim().toLowerCase();
34 if (v === "" || v === "d1") return "d1";
35 if (v === "mysql" || v === "prisma") return v;
36 // 非法取值按空处理,上层会识别为不可用
37 return "";
38}
39
40// 模块级单例缓存(每个 Worker 实例内共享)
41let _cachedDao: Dao | null = null;

Callers 3

handleBootstrapFunction · 0.90
handleSetupFunction · 0.90
getDaoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected