| 17 | import { assertFalse, assertTrue, deepStrictEqual, strictEqual } from "./utils/assert.ts" |
| 18 | |
| 19 | class 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 | |
| 39 | const data = new SensitiveData("my-secret-key") |
| 40 |
nothing calls this directly
no outgoing calls
no test coverage detected