API reference
@rivus/agent-kit/redact
redact, redactText: hide home path spellings and secret-shaped strings — anywhere, no imports
Functions
redact()
function redact<T>(value: T, options: RedactOptions): T;Returns a copy of a JSON-like value with redactText applied to every string, including object keys. Arrays and
plain objects are copied; other objects (dates, class instances) are returned as they are, and nothing is mutated.
Type Parameters
T
T
Parameters
value
T
options
RedactOptions
Returns
T
redactText()
function redactText(text: string, options: RedactOptions): string;Replaces every spelling of options.home with ~ and every secret-shaped string with [redacted]. Matching
ignores case, so a mixed-case spelling on a case-insensitive file system is hidden too, at the cost of also hiding
a different directory that differs only in case.
Parameters
text
string
options
RedactOptions
Returns
string