UNPKG

693 BJavaScriptView Raw
1import baseIsTypedArray from './_baseIsTypedArray.js';
2import baseUnary from './_baseUnary.js';
3import nodeUtil from './_nodeUtil.js';
4
5/* Node.js helper references. */
6var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
7
8/**
9 * Checks if `value` is classified as a typed array.
10 *
11 * @static
12 * @memberOf _
13 * @since 3.0.0
14 * @category Lang
15 * @param {*} value The value to check.
16 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
17 * @example
18 *
19 * _.isTypedArray(new Uint8Array);
20 * // => true
21 *
22 * _.isTypedArray([]);
23 * // => false
24 */
25var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
26
27export default isTypedArray;