(value: T, options: PiiRedactionOptions)
| 177 | * block-output stages, so it defaults callers toward `onFailure: 'throw'`. |
| 178 | */ |
| 179 | export 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`. |
no test coverage detected