Skip to content

assertUndefined

Assert that a value is strictly undefined, with type-narrowing to the undefined type.

import { assertUndefined } from "@kensio/smartass";
const value: unknown = undefined;
assertUndefined(value);
// value is now narrowed to undefined

Source file: src/assert/undefined/undefined.assert.ts