Using the Node Package Manager (NPM)
npm i type-is-plain-object
Using the Node Package Manager (NPM)
npm i type-is-plain-object
...Or referencing the the .js or .min.js file through a script tag. This requires a custom build
<script src="your/path/isPlainObject.min.js"></script>
In Node (CommonJS):
const isPlainObject = require('type-is-plain-object');
... Or in the Browser (ES6 modules):
import isPlainObject from 'type-is-plain-object';
Examples:
console.log(isPlainObject({ a: 100 })); // --> true
console.log(isPlainObject()); // --> false
console.log(isPlainObject(null)); // --> false
console.log(isPlainObject(100)); // --> false
console.log(isPlainObject('foo')); // --> false
console.log(isPlainObject(true)); // --> false
console.log(isPlainObject([1, 2, 3])); // --> false
console.log(isPlainObject(() => {...})); // --> false
The Custom Build process will produce the .js and the .min.js files in the auto-generated dist folder.
The following steps will guide through the process:
npm install
npm build
to generate the dist folder <script>
tag If you find any issues, feel free to submit a pull request
This project is under the MIT License.