keys.js 297 B

12345678910111213141516171819
  1. /**
  2. * Gets the keys for an object.
  3. *
  4. * @return {Array} keys
  5. * @api private
  6. */
  7. module.exports = Object.keys || function keys (obj){
  8. var arr = [];
  9. var has = Object.prototype.hasOwnProperty;
  10. for (var i in obj) {
  11. if (has.call(obj, i)) {
  12. arr.push(i);
  13. }
  14. }
  15. return arr;
  16. };