mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
committed by
John-David Dalton
parent
43bcecf52f
commit
677c01b753
@@ -1,5 +1,4 @@
|
|||||||
import arrayFilter from './arrayFilter.js'
|
import arrayFilter from './arrayFilter.js'
|
||||||
import stubArray from '../stubArray.js'
|
|
||||||
|
|
||||||
/** Built-in value references. */
|
/** Built-in value references. */
|
||||||
const propertyIsEnumerable = Object.prototype.propertyIsEnumerable
|
const propertyIsEnumerable = Object.prototype.propertyIsEnumerable
|
||||||
@@ -14,7 +13,7 @@ const nativeGetSymbols = Object.getOwnPropertySymbols
|
|||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
* @returns {Array} Returns the array of symbols.
|
* @returns {Array} Returns the array of symbols.
|
||||||
*/
|
*/
|
||||||
const getSymbols = !nativeGetSymbols ? stubArray : object => {
|
const getSymbols = !nativeGetSymbols ? () => [] : object => {
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import arrayPush from './arrayPush.js'
|
import arrayPush from './arrayPush.js'
|
||||||
import getSymbols from './getSymbols.js'
|
import getSymbols from './getSymbols.js'
|
||||||
import stubArray from '../stubArray.js'
|
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
const nativeGetSymbols = Object.getOwnPropertySymbols
|
const nativeGetSymbols = Object.getOwnPropertySymbols
|
||||||
@@ -12,7 +11,7 @@ const nativeGetSymbols = Object.getOwnPropertySymbols
|
|||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
* @returns {Array} Returns the array of symbols.
|
* @returns {Array} Returns the array of symbols.
|
||||||
*/
|
*/
|
||||||
const getSymbolsIn = !nativeGetSymbols ? stubArray : object => {
|
const getSymbolsIn = !nativeGetSymbols ? () => [] : object => {
|
||||||
const result = []
|
const result = []
|
||||||
while (object) {
|
while (object) {
|
||||||
arrayPush(result, getSymbols(object))
|
arrayPush(result, getSymbols(object))
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import root from './.internal/root.js'
|
import root from './.internal/root.js'
|
||||||
import stubFalse from './stubFalse.js'
|
|
||||||
|
|
||||||
/** Detect free variable `exports`. */
|
/** Detect free variable `exports`. */
|
||||||
const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports
|
const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports
|
||||||
@@ -31,6 +30,6 @@ const nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined
|
|||||||
* isBuffer(new Uint8Array(2))
|
* isBuffer(new Uint8Array(2))
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
const isBuffer = nativeIsBuffer || stubFalse
|
const isBuffer = nativeIsBuffer || (() => false)
|
||||||
|
|
||||||
export default isBuffer
|
export default isBuffer
|
||||||
|
|||||||
Reference in New Issue
Block a user