MCPcopy Create free account
hub / github.com/EvoMap/evolver / redactValue

Function redactValue

src/webui/observer/redact.js:24–42  ·  view source on GitHub ↗
(value, depth = 0)

Source from the content-addressed store, hash-verified

22].join('|'), 'gi');
23
24function redactValue(value, depth = 0) {
25 if (depth > 8) return '[REDACTED_DEPTH]';
26 if (Array.isArray(value)) return value.map((entry) => redactValue(entry, depth + 1));
27 if (!value || typeof value !== 'object') {
28 return typeof value === 'string' ? redactText(value) : value;
29 }
30
31 const out = {};
32 for (const [key, child] of Object.entries(value)) {
33 if (SECRET_KEY_RE.test(key)) {
34 out[key] = '[REDACTED]';
35 } else if (isLargeSensitiveField(key, child)) {
36 out[key] = '[REDACTED_SENSITIVE_DETAIL]';
37 } else {
38 out[key] = redactValue(child, depth + 1);
39 }
40 }
41 return out;
42}
43
44function redactText(text) {
45 if (typeof text !== 'string') return text;

Callers 6

getPersonalityFunction · 0.85
normalizePipelineEventFunction · 0.85
readMailboxMessagesFunction · 0.85
readProxySnapshotsFunction · 0.85
getStatusFunction · 0.85
buildRunDetailFunction · 0.85

Calls 2

redactTextFunction · 0.85
isLargeSensitiveFieldFunction · 0.85

Tested by

no test coverage detected