Package: effect
Module: Redacted
Deletes the stored value for a Redacted wrapper, making future
Redacted.value calls on that wrapper fail.
When to use
Use when a Redacted wrapper should no longer be able to reveal its stored
value.
Gotchas
This unsafe operation does not zero memory and does not affect other references to the original value. It only removes the value from the internal redacted registry.
Example (Wiping a redacted value)
import { Redacted } from "effect"
import * as assert from "node:assert"
const API_KEY = Redacted.make("1234567890")
assert.equal(Redacted.value(API_KEY), "1234567890")
Redacted.wipeUnsafe(API_KEY)
assert.throws(
() => Redacted.value(API_KEY),
new Error("Unable to get redacted value")
)
Signature
declare const wipeUnsafe: <T>(self: Redacted<T>) => boolean
Since v4.0.0