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.

25 lines
754 B

4 years ago
  1. var arrayPush = require('./_arrayPush'),
  2. getPrototype = require('./_getPrototype'),
  3. getSymbols = require('./_getSymbols'),
  4. stubArray = require('./stubArray');
  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. module.exports = getSymbolsIn;