assertSetNotIncludes
Assert that a Set does not include a specific member, with type narrowing.
Membership uses the Set’s own has(), which is a SameValueZero match, so an object only fails the assertion by being a reference the Set already holds, rather than equivalent in value to a member.
Note that absence has no type-level witness, so this narrows an unknown value to a Set and stops there.
import { assertSetNotIncludes } from "@kensio/smartass";
const value: unknown = new Set(["draft", "featured"]);
assertSetNotIncludes(value, "archived");
// value is now narrowed to ReadonlySet<unknown>Source
Section titled “Source”Source file: src/assert/set-not-includes/set-not-includes.assert.ts
