1.0.0 • Published 8 years ago

handy-is-empty-object v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

typeOf

Check a object is empty

Reference

http://stackoverflow.com/questions/4994201/is-object-empty

Example

isEmpty(""), // true
isEmpty(33), // true (arguably could be a TypeError)
isEmpty([]), // true
isEmpty({}), // true
isEmpty({length: 0, custom_property: []}), // true

isEmpty("Hello"), // false
isEmpty([1,2,3]), // false
isEmpty({test: 1}), // false
isEmpty({length: 3, custom_property: [1,2,3]}) // false