Skip to content

assertTypeObject

Assert that a value is of type object, with type-narrowing.

import { assertTypeObject } from "@kensio/smartass";
const value: unknown = { name: "Ada" };
assertTypeObject(value);
// value is now narrowed to object

Source file: src/assert/type-object/type-object.assert.ts