@xobotyi/is-obj
v1.1.0
Published
Check if given value is an object
Readme
Returns true on all objectish values except null, e.g. functions, arrays, dates and so on.
Installation note
This package written in TypeScript and delivered with 3 versions:
mainfield ofpackage.jsonis pointing to transpiled ES5 version with CJS modules resolution;modulefield is pointing to transpiled ES5 version with ES modules resolution;esnextfield is pointing to the ESNext version with ES modules resolution;
Depending on your targets you may have to use Webpack and/or
Babel to pull untranspiled version of package.
See some tips on wiring thing up: https://2ality.com/2017/06/pkg-esnext.html
Usage
import { isObj } from "@xobotyi/is-obj";
isObj(1); // => false
isObj(()=>{}); // => true
isObj(null); // => false
isObj([1,2,3]); // => trueRelated projects
- cnbuilder - Yet another classname string builder (the fastest one)
- @xobotyi/is-plain-obj - Check if given value is a plain object
