UNPKG

ut2

Version:

一个现代 JavaScript 实用工具库。[点击查看在线文档]。

17 lines (14 loc) 525 B
import getTag from './internals/getTag.js'; import { nodeIsTypedArray } from './internals/nodeUtil.js'; import isArrayLikeObject from './isArrayLikeObject.js'; var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(16|32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; function isTypedArray(value) { if (nodeIsTypedArray) { return nodeIsTypedArray(value); } if (isArrayLikeObject(value)) { return typedArrayPattern.test(getTag(value)); } return false; } export { isTypedArray as default };