Determine if a value is an object
npm install @typeforce/is-object[license-shield-url]: https://img.shields.io/github/license/typeforce-js/is-object.svg?style=flat-square
[license-url]: https://github.com/Typeforce-JS/is-object/blob/master/LICENSE
[npm-downloads-shield-url]: https://img.shields.io/npm/dt/@typeforce/is-object.svg?style=flat-square
[npm-version-shield-url]: https://img.shields.io/npm/v/@typeforce/is-object.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@typeforce/is-object
[unpkg-shield-url]: https://img.shields.io/badge/unpkg-up--to--date-brightgreen.svg?style=flat-square
[unpkg-url]: https://unpkg.com/@typeforce/is-object/dist/index.min.js
[![NPM][npm-version-shield-url]][npm-url]
[![NPM][npm-downloads-shield-url]][npm-url]
[![CDN][unpkg-shield-url]][unpkg-url]
[![LICENSE][license-shield-url]][license-url]
Determine if a value is an object.
A value is an object if it is of type object, or is an instance of reference
type Object.
``shell`
npm install @typeforce/is-object --save # Install package via NPM
`javascript
import { expect } from "chai";
import isObject from "@typeforce/is-object";
expect(isObject(new Object())).to.be.true;
expect(isObject({ foo: true })).to.be.true;
expect(isObject([ 1, 2, 3 ]).to.be.false;
expect(isObject(undefined)).to.be.false;
expect(isObject(null)).to.be.false;
`
This package contains TypeScript type declarations. Furthermore, the package
uses TypeScript type guards to allow type inference to influence IntelliSense.
`typescriptx
if (isObject(x)) {
// IntelliSense now knows is an object.`
let y: object = x;
}
This package can be imported via unpkg as demonstrated
below.
`html`
When building the project, a folder named dist/ will be created if it does notdist/
already exist, where the compiled code will be outputted to. Type declaration
files will also be generated and outputted to the folder.
A minified Javascript version of the entire project will be generated and
outputted to dist/index.min.js.
`shell`
npm install # Installs dependencies.
npm run build # Build the project.
This package uses Gulp for building, and Chai
and Mocha for testing.
`shell`
npm test # Run tests.
Refer to the LICENSE` file for license information.