npm.io
1.0.0 • Published 11 years ago

multi-typeof

Licence
MIT
Version
1.0.0
Deps
0
Vulns
0
Weekly
0
Stars
4

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

Keywords