$.enum-keys.js 385 B

1234567891011121314
  1. // all enumerable object keys, includes symbols
  2. var $ = require('./$');
  3. module.exports = function(it){
  4. var keys = $.getKeys(it)
  5. , getSymbols = $.getSymbols;
  6. if(getSymbols){
  7. var symbols = getSymbols(it)
  8. , isEnum = $.isEnum
  9. , i = 0
  10. , key;
  11. while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key);
  12. }
  13. return keys;
  14. };