MCPcopy Create free account
hub / github.com/Effect-TS/effect / SensitiveData

Class SensitiveData

packages/effect/test/Formatter.test.ts:19–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17import { assertFalse, assertTrue, deepStrictEqual, strictEqual } from "./utils/assert.ts"
18
19class SensitiveData implements Redactable.Redactable {
20 constructor(private secret: string) {}
21
22 f(s: string) {
23 this.secret += s
24 }
25
26 toString() {
27 return this.secret
28 }
29
30 toJSON() {
31 return { secret: this.secret }
32 }
33
34 [Redactable.symbolRedactable]() {
35 return { secret: "[REDACTED]" }
36 }
37}
38
39const data = new SensitiveData("my-secret-key")
40

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected