Package Exports
- is-obj-type
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 (is-obj-type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-obj-type
Good judgment of object type.
install
$ npm install --save isTypeExample
const is = require('is-obj-type');
console.log(is.num(2));
var some = function(){
//...
}
var obj = new some();
var isSome = is("some");
console.log(isSome(obj));
class someCls{};
var someObj = new someCls();
var isSomeCls = is("someCls");
console.log(isSomeCls(someObj));
var isSomeOrCls = is.all("some","someCls");
console.log(isSomeOrCls(obj));
console.log(isSomeOrCls(someObj));output
true // x5Usage
const is = require('isType');Standard object
is.num(1); // => true
is.str(""); // => true
is.bool(true); // => true
is.arr([]); // => true
is.null(null); // => true
is.func(()=>{}); // => true
is.obj({}); // => true
is.undefined(undefined); // => true
is.symbol(Symbol("symbol")); // => true
is.global(window); // Browser
is.global(global); // NodePlain object pair object
is.plain(new function(){}) // => false
is.plain(Object.create(null)) // => false
is.plain({})// => trueCustom class
var some = function(){};
var sObj = new some();
var isSome = is("some");
isSome(sObj);// => true
class somecls{};
var clsObj = new somecls();
var isSomecls = is("somecls");
isSomecls(clsObj);// => truemulit condition
var isSomeOrCls = is.all("some","somecls");
isSomeOrCls(sObj);// => true
isSomeOrCls(clsObj);// => trueAdvanced
Function Class overloading
// ...About
*npm(new release) need to pull dev-lib with cmd
npm i --only=dev
browserify
$ npm run browserifytest
$ npm run test