var keys =require('object-keys');var assert =require('assert');/* when Object.keys is not present */deleteObject.keys;var shimmedKeys =keys.shim();assert.equal(shimmedKeys, keys);assert.deepEqual(Object.keys(obj),keys(obj));
var keys =require('object-keys');var assert =require('assert');/* when Object.keys is present */var shimmedKeys =keys.shim();assert.equal(shimmedKeys,Object.keys);assert.deepEqual(Object.keys(obj),keys(obj));
Source
Implementation taken directly from es5-shim, with modifications, including from lodash.
Tests
Simply clone the repo, npm install, and run npm test