MCPcopy Create free account
hub / github.com/cortexkit/magic-context / collectEmptyStringPaths

Function collectEmptyStringPaths

packages/plugin/src/config/index.ts:394–408  ·  view source on GitHub ↗
(value: unknown, prefix = "")

Source from the content-addressed store, hash-verified

392}
393
394function collectEmptyStringPaths(value: unknown, prefix = ""): string[] {
395 if (typeof value === "string") {
396 return value === "" && prefix ? [prefix] : [];
397 }
398 if (Array.isArray(value) || value === null || typeof value !== "object") {
399 return [];
400 }
401
402 const paths: string[] = [];
403 for (const [key, child] of Object.entries(value as Record<string, unknown>)) {
404 const nextPrefix = prefix ? `${prefix}.${key}` : key;
405 paths.push(...collectEmptyStringPaths(child, nextPrefix));
406 }
407 return paths;
408}
409
410function bindSubstitutionFailures(
411 loaded: LoadedConfigFileDetailed | null,

Callers 1

bindSubstitutionFailuresFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected