es7-is-empty-obj

Check if object is empty the modern way ⚡

Usage no npm install needed!

<script type="module">
  import es7IsEmptyObj from 'https://cdn.skypack.dev/es7-is-empty-obj';
</script>

README

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