diff --git a/lib/index.js b/lib/index.js index a11fa5c..6482158 100644 --- a/lib/index.js +++ b/lib/index.js @@ -61,6 +61,8 @@ function isEmpty(val) { if (has.call(val, key)) return false } + if (Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(val).length > 0) return false + return true } } diff --git a/test/index.js b/test/index.js index 03e5e24..825ea74 100644 --- a/test/index.js +++ b/test/index.js @@ -12,6 +12,7 @@ describe('is-empty', function () { assert(empty({}) == true) assert(empty({ a: 'b' }) == false) assert(empty({ length: 0 }) == false) + assert(empty({ [Symbol()]: 1 }) == false) }) it('handles strings', function () {