MCPcopy Create free account
hub / github.com/ether/etherpad / pathMatches

Function pathMatches

src/node/utils/AdminSettingsRedact.ts:20–30  ·  view source on GitHub ↗
(path: ReadonlyArray<string>)

Source from the content-addressed store, hash-verified

18];
19
20const pathMatches = (path: ReadonlyArray<string>): boolean => {
21 for (const pattern of REDACT_PATHS) {
22 if (pattern.length !== path.length) continue;
23 let ok = true;
24 for (let i = 0; i < pattern.length; i++) {
25 if (pattern[i] !== '*' && pattern[i] !== path[i]) { ok = false; break; }
26 }
27 if (ok) return true;
28 }
29 return false;
30};
31
32const walk = (value: unknown, path: string[]): unknown => {
33 if (pathMatches(path)) return SENTINEL;

Callers 1

walkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected