mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Remove check for existence of getOwnPropertySymbols (#4102)
This commit is contained in:
committed by
John-David Dalton
parent
8eccdd098a
commit
151e316263
@@ -13,7 +13,7 @@ const nativeGetSymbols = Object.getOwnPropertySymbols
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of symbols.
|
||||
*/
|
||||
const getSymbols = !nativeGetSymbols ? () => [] : (object) => {
|
||||
function getSymbols (object) {
|
||||
if (object == null) {
|
||||
return []
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import getSymbols from './getSymbols.js'
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
const nativeGetSymbols = Object.getOwnPropertySymbols
|
||||
|
||||
/**
|
||||
* Creates an array of the own and inherited enumerable symbols of `object`.
|
||||
*
|
||||
@@ -10,7 +7,7 @@ const nativeGetSymbols = Object.getOwnPropertySymbols
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of symbols.
|
||||
*/
|
||||
const getSymbolsIn = !nativeGetSymbols ? () => [] : (object) => {
|
||||
function getSymbolsIn (object) {
|
||||
const result = []
|
||||
while (object) {
|
||||
result.push(...getSymbols(object))
|
||||
|
||||
Reference in New Issue
Block a user