use isObjectLike module instead of (typeof value == 'object' && value !== null) in another modules (#3650)

This commit is contained in:
alireza valizade
2018-02-19 11:56:01 +03:30
committed by John-David Dalton
parent 678eb000b7
commit c1f805f497
5 changed files with 10 additions and 5 deletions

View File

@@ -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