Skip to main content

Function: scrubMeta()

Every secret-bearing key dropped, at any depth. Past the cap the subtree is truncated, not walked.

scrubMeta(meta: object, depth?: number): Record<string, unknown>

Defined in: scrub.ts:27

Every secret-bearing key dropped, at any depth. Past the cap the subtree is truncated, not walked.

Parameters

meta

object

depth?

number = 0

Returns

Record<string, unknown>

Example

scrubMeta({ widgetId: 'w1', detail: { password: 'leak-me' } })
// -> { widgetId: 'w1', detail: {} }: 'password' matches the secret pattern, 'detail' and 'widgetId' don't