You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

get-property-names.js 491B

1234567891011121314151617
  1. "use strict";
  2. var uniq = require("../array/#/uniq")
  3. , value = require("./valid-value")
  4. , push = Array.prototype.push
  5. , getOwnPropertyNames = Object.getOwnPropertyNames
  6. , getPrototypeOf = Object.getPrototypeOf;
  7. module.exports = function (obj) {
  8. var keys;
  9. obj = Object(value(obj));
  10. keys = getOwnPropertyNames(obj);
  11. while ((obj = getPrototypeOf(obj))) {
  12. push.apply(keys, getOwnPropertyNames(obj));
  13. }
  14. return uniq.call(keys);
  15. };