liudong
2023-05-29 340f156319b863525e50e900c58e59b86ecb3d5e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
define(['./_setup', './isDataView', './constant', './_isBufferLike'], function (_setup, isDataView, constant, _isBufferLike) {
 
  // Is a given value a typed array?
  var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
  function isTypedArray(obj) {
    // `ArrayBuffer.isView` is the most future-proof, so use it when available.
    // Otherwise, fall back on the above regular expression.
    return _setup.nativeIsView ? (_setup.nativeIsView(obj) && !isDataView(obj)) :
                  _isBufferLike(obj) && typedArrayPattern.test(_setup.toString.call(obj));
  }
 
  var isTypedArray$1 = _setup.supportsArrayBuffer ? isTypedArray : constant(false);
 
  return isTypedArray$1;
 
});