sahariko / is-object-literal

Validates a given value is a literal Object

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Validates a given value is a literal Object


Languages

Language:JavaScript 100.0%