_getSymbolsIn.js 752 B

12345678910111213141516171819202122232425
  1. import arrayPush from './_arrayPush.js';
  2. import getPrototype from './_getPrototype.js';
  3. import getSymbols from './_getSymbols.js';
  4. import stubArray from './stubArray.js';
  5. /* Built-in method references for those with the same name as other `lodash` methods. */
  6. var nativeGetSymbols = Object.getOwnPropertySymbols;
  7. /**
  8. * Creates an array of the own and inherited enumerable symbols of `object`.
  9. *
  10. * @private
  11. * @param {Object} object The object to query.
  12. * @returns {Array} Returns the array of symbols.
  13. */
  14. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  15. var result = [];
  16. while (object) {
  17. arrayPush(result, getSymbols(object));
  18. object = getPrototype(object);
  19. }
  20. return result;
  21. };
  22. export default getSymbolsIn;