@hldprk/type

2.0.3 • Public • Published

This package defines a utlity class for simple type-checking using a new Type class.

Type is constructed using one or more constructor functions (like String) or strings (like 'string' or 'number') for primitive types.

Type also has two methods, compare and check, which act to test objects against the type information which is held by the Type.

compare accepts any object and returns an array containing booleans which represent whether or not the given object matches the held type information.

check accepts any object and will throw an error if none of the held type information matches the given object.

Readme

Keywords

none

Package Sidebar

Install

npm i @hldprk/type

Weekly Downloads

0

Version

2.0.3

License

ISC

Unpacked Size

2.5 kB

Total Files

4

Last publish

Collaborators

  • hldprk