0.1.1 • Published 1 year ago
@std-types/assert-type v0.1.1
@std-types/assert-type
Assert that a value is the given type
Installation
npm install @std-types/assert-type
Usage
import assertType, { getAssertType } from "@std-types/assert-type";
const assertString = getAssertType("string");
assertString("hello"); // OK
assertString(42); // Error
assertType("hello", isString); // OK
assertType(42, isString); // Error
0.1.1
1 year ago