D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
public_html
/
wabot.delyntro.com
/
node_modules
/
slow-redact
/
Filename :
index.test-d.ts
back
Copy
import { expectType, expectAssignable } from "tsd"; import slowRedact from "."; import type { redactFn, redactFnNoSerialize } from "."; // should return redactFn expectType<redactFn>(slowRedact()); expectType<redactFn>(slowRedact({ paths: [] })); expectType<redactFn>(slowRedact({ paths: ["some.path"] })); expectType<redactFn>(slowRedact({ paths: [], censor: "[REDACTED]" })); expectType<redactFn>(slowRedact({ paths: [], strict: true })); expectType<redactFn>(slowRedact({ paths: [], serialize: JSON.stringify })); expectType<redactFn>(slowRedact({ paths: [], serialize: true })); expectType<redactFnNoSerialize>(slowRedact({ paths: [], serialize: false })); expectType<redactFn>(slowRedact({ paths: [], remove: true })); // should return string expectType<string>(slowRedact()("")); // should return string or T expectAssignable<string | { someField: string }>( slowRedact()({ someField: "someValue" }) );