multi-typeof
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/multi-typeof package

1.0.0 • Public • Published

multi-typeof Build Status

Check something against an array of types.

Install

$ npm install --save multi-typeof

Example

var multiTypeof = require('multi-typeof');
 
if (!multiTypeof(65, ['string', 'array'])) {
    throw new TypeError('Expected a string or an array');
}

API

multiTypeof(input, types)

input

Required
Type: Any type

Value to test.

types

Required
Type: array

Types to check against.

License

MIT © Andreas Gillström

Package Sidebar

Install

npm i multi-typeof

Weekly Downloads

234

Version

1.0.0

License

MIT

Last publish

Collaborators

  • gillstrom