mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
use isObjectLike module instead of (typeof value == 'object' && value !== null) in another modules (#3650)
This commit is contained in:
committed by
John-David Dalton
parent
678eb000b7
commit
c1f805f497
@@ -1,5 +1,6 @@
|
||||
import getTag from './.internal/getTag.js'
|
||||
import nodeUtil from './.internal/nodeUtil.js'
|
||||
import isObjectLike from './isObjectLike'
|
||||
|
||||
/** Used to match `toStringTag` values of typed arrays. */
|
||||
const reTypedTag = /^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)\]$/
|
||||
@@ -24,6 +25,6 @@ const nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray
|
||||
*/
|
||||
const isTypedArray = nodeIsTypedArray
|
||||
? (value) => nodeIsTypedArray(value)
|
||||
: (value) => typeof value == 'object' && value !== null && reTypedTag.test(getTag(value))
|
||||
: (value) => isObjectLike(value) && reTypedTag.test(getTag(value))
|
||||
|
||||
export default isTypedArray
|
||||
|
||||
Reference in New Issue
Block a user