1.0.1 • Published 5 years ago

es7-is-empty-obj v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

es7-is-empty-obj Build Status

Check if object is empty the modern way :zap:

Highlights

  • Uses the ES7 Object.keys()
  • No dependencies
  • ~ 5 lines of code

Install

$ npm install es7-is-empty-obj

Usage

const isEmptyObj = require('es7-is-empty-obj');

const objectOne = {};
const objectTwo = {'foo': 'bar'};

isEmptyObj(objectOne);
//=> true

isEmptyObj(objectTwo);
//=> false

API

isEmptyObj(obj)

obj

Type: Object

License

MIT © Antoni Kepinski