JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q58752F
  • License

Checks the type of a value and throws if not okey. More clear and simple syntax and consistent error messages.

Package Exports

  • assert-kindof

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (assert-kindof) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm mit license build status coverage status deps status

Checks the type of a value and throws if not okey. More clear and simple syntax and consistent error messages.

  • is-kindof returns true or false
  • assert-kindof returns true or throws TypeError

Install

npm i --save assert-kindof
npm test

Usage

For more use-cases see the tests

notice: that tunnckoCore/is-kindof is exposed as is.kindof

var is = require('assert-kindof');

is.object('foo');                     //=> throw TypeError
is.a.object('foo');                   //=> throw TypeError
is.an.object('foo');                  //=> throw TypeError
is.not.a.object({a: 'b'});            //=> throw TypeError
is.not.an.object({a: 'b'});           //=> throw TypeError
is.a.not.object({a: 'b'});            //=> throw TypeError
is.an.not.object({a: 'b'});           //=> throw TypeError

is.kindof.object('foo');              //=> false
is.kindof.array('foo');               //=> false
is.kindof.null(null);                 //=> true
is.kindof.symbol('foo');              //=> false
is.kindof.symbol(Symbol('foo'));      //=> true

API / CLI

Author

Charlike Mike Reagent

License MIT license

Copyright (c) 2015 Charlike Mike Reagent, contributors.
Released under the MIT license.


Proudly generated by docks(1), March 29, 2015