MCPcopy Create free account
hub / github.com/chhoumann/quickadd / findCaseInsensitiveMatch

Function findCaseInsensitiveMatch

src/utils/valueSyntax.ts:108–123  ·  view source on GitHub ↗
(
	vars: Map<string, unknown>,
	candidate: string,
)

Source from the content-addressed store, hash-verified

106}
107
108function findCaseInsensitiveMatch(
109 vars: Map<string, unknown>,
110 candidate: string,
111): string | null {
112 const lower = candidate.toLowerCase();
113 let match: string | null = null;
114
115 for (const key of vars.keys()) {
116 if (key.toLowerCase() !== lower) continue;
117 if (vars.get(key) === undefined) continue;
118 if (match) return null;
119 match = key;
120 }
121
122 return match;
123}
124
125export function resolveExistingVariableKey(
126 vars: Map<string, unknown>,

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected