MCPcopy Index your code
hub / github.com/simstudioai/sim / redactObjectStrings

Function redactObjectStrings

apps/sim/lib/logs/execution/pii-redaction.ts:179–191  ·  view source on GitHub ↗
(value: T, options: PiiRedactionOptions)

Source from the content-addressed store, hash-verified

177 * block-output stages, so it defaults callers toward `onFailure: 'throw'`.
178 */
179export async function redactObjectStrings<T>(value: T, options: PiiRedactionOptions): Promise<T> {
180 const collected: string[] = []
181 transformStrings(value, (s) => {
182 collected.push(s)
183 return s
184 })
185
186 if (collected.length === 0) return value
187
188 const { masked } = await maskCollected(collected, options)
189 let index = 0
190 return transformStrings(value, () => masked[index++]) as T
191}
192
193/**
194 * Mask PII across an execution's `traceSpans` / `finalOutput` / `workflowInput`.

Callers 6

maskAndReStoreFunction · 0.90
executeWorkflowCoreFunction · 0.90
maskContentForStorageMethod · 0.90
executeMethod · 0.90

Calls 3

transformStringsFunction · 0.85
maskCollectedFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected