main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
884 bytes
|
Line | |
---|
1 | import arrayFilter from './_arrayFilter.js';
|
---|
2 | import stubArray from './stubArray.js';
|
---|
3 |
|
---|
4 | /** Used for built-in method references. */
|
---|
5 | var objectProto = Object.prototype;
|
---|
6 |
|
---|
7 | /** Built-in value references. */
|
---|
8 | var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
---|
9 |
|
---|
10 | /* Built-in method references for those with the same name as other `lodash` methods. */
|
---|
11 | var nativeGetSymbols = Object.getOwnPropertySymbols;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Creates an array of the own enumerable symbols of `object`.
|
---|
15 | *
|
---|
16 | * @private
|
---|
17 | * @param {Object} object The object to query.
|
---|
18 | * @returns {Array} Returns the array of symbols.
|
---|
19 | */
|
---|
20 | var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
---|
21 | if (object == null) {
|
---|
22 | return [];
|
---|
23 | }
|
---|
24 | object = Object(object);
|
---|
25 | return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
---|
26 | return propertyIsEnumerable.call(object, symbol);
|
---|
27 | });
|
---|
28 | };
|
---|
29 |
|
---|
30 | export default getSymbols;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.