rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.37k stars 195 forks source link

Check for empty object #83

Closed ramivalta closed 8 years ago

ramivalta commented 8 years ago

Adds a check to isMergableObject function that ensures it returns false for an empty object. Ping @rtfeldman

rtfeldman commented 8 years ago

Awesome, thanks!

rtfeldman commented 8 years ago

@tiil Ah, spoke too soon - test failures. (Apparently I didn't have Travis set up to build PRs - sorry about that!)

I reverted this on master. Can you address the test failures and make a fresh PR?

ramivalta commented 8 years ago

I'm on it, apologies for not running the tests before submitting.

ramivalta commented 8 years ago

This must be because Object.keys is an ES5 feature, and some old browsers (namely IE8) doesn't support it. Would you be against introducing a dependency on es5-shim (https://github.com/es-shims/es5-shim)?

ramivalta commented 8 years ago

Actually we could just use lodash.keys since lodash is already a devDependency.