MCPcopy Index your code
hub / github.com/infinitered/reactotron / matchesStatePath

Function matchesStatePath

lib/reactotron-mcp/src/redaction.ts:399–412  ·  view source on GitHub ↗
(currentPath: string, patterns: string[])

Source from the content-addressed store, hash-verified

397}
398
399function matchesStatePath(currentPath: string, patterns: string[]): boolean {
400 for (const pattern of patterns) {
401 if (pattern.endsWith(".*")) {
402 const prefix = pattern.slice(0, -2)
403 // "auth.tokens.*" matches "auth.tokens.access" but NOT "auth.tokens" itself
404 if (currentPath.startsWith(prefix + ".") && currentPath.length > prefix.length + 1) {
405 return true
406 }
407 } else if (currentPath === pattern) {
408 return true
409 }
410 }
411 return false
412}
413
414/**
415 * Check whether a storage key (e.g. "auth:password", "auth_password", "user.api_key")

Callers 1

redactObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected