_baseGetAllKeys.js 739 B

123456789101112131415161718192021
  1. var arrayPush = require('./_arrayPush'),
  2. isArray = require('./isArray');
  3. /**
  4. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  5. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  6. * symbols of `object`.
  7. *
  8. * @private
  9. * @param {Object} object The object to query.
  10. * @param {Function} keysFunc The function to get the keys of `object`.
  11. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  12. * @returns {Array} Returns the array of property names and symbols.
  13. */
  14. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  15. var result = keysFunc(object);
  16. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  17. }
  18. module.exports = baseGetAllKeys;