import { expectType, expectAssignable } from "tsd"; import slowRedact from "."; import type { redactFn, redactFnNoSerialize } from "."; // should return redactFn expectType(slowRedact()); expectType(slowRedact({ paths: [] })); expectType(slowRedact({ paths: ["some.path"] })); expectType(slowRedact({ paths: [], censor: "[REDACTED]" })); expectType(slowRedact({ paths: [], strict: true })); expectType(slowRedact({ paths: [], serialize: JSON.stringify })); expectType(slowRedact({ paths: [], serialize: true })); expectType(slowRedact({ paths: [], serialize: false })); expectType(slowRedact({ paths: [], remove: true })); // should return string expectType(slowRedact()("")); // should return string or T expectAssignable( slowRedact()({ someField: "someValue" }) );