is-object-literal
v1.0.1
Published
Validates a given value is a literal Object
Downloads
3
Maintainers
Readme
is-object-literal
Validates a given value is a literal Object.
Table of Contents
Installation
Install the package:
npm i is-object-literal
API
ES6
import isObjectLiteral from 'is-object-literal';
const object = {};
const nullValue = null;
const somethingElse = 1;
console.log(isObjectLiteral(object)); // true
console.log(isObjectLiteral(nullValue)); // false
console.log(isObjectLiteral(somethingElse)); // false
ES5
const isObjectLiteral = require('is-object-literal');
const object = {};
const nullValue = null;
const somethingElse = 1;
console.log(isObjectLiteral(object)); // true
console.log(isObjectLiteral(nullValue)); // false
console.log(isObjectLiteral(somethingElse)); // false