UNPKG

672 BJavaScriptView Raw
1import arrayPush from './_arrayPush';
2import getPrototype from './_getPrototype';
3import getSymbols from './_getSymbols';
4
5/** Built-in value references. */
6var getOwnPropertySymbols = Object.getOwnPropertySymbols;
7
8/**
9 * Creates an array of the own and inherited enumerable symbol properties
10 * of `object`.
11 *
12 * @private
13 * @param {Object} object The object to query.
14 * @returns {Array} Returns the array of symbols.
15 */
16var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) {
17 var result = [];
18 while (object) {
19 arrayPush(result, getSymbols(object));
20 object = getPrototype(object);
21 }
22 return result;
23};
24
25export default getSymbolsIn;