Skip to content

assertTypeFunction

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

import { assertTypeFunction } from "@kensio/smartass";
const callback: unknown = () => "ok";
assertTypeFunction(callback);
// callback is now narrowed to Function

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