Skip to content

filterByNamespace

filterByNamespace(raw, namespace): Record<string, string | undefined>

Defined in: utils/filter-by-namespace.ts:12

Filter raw env vars to only those matching a namespace prefix, stripping the prefix from each key before returning.

Case-insensitive: “holocron_debug” and “HOLOCRON_DEBUG” both match namespace “HOLOCRON”.

Record<string, string | undefined>

string

Record<string, string | undefined>

filterByNamespace({ HOLOCRON_DEBUG: "true", PORT: "3000" }, "HOLOCRON")
// → { DEBUG: "true" }