isDataView.js 670 B

123456789101112131415161718
  1. var _tagTester = require('./_tagTester.js');
  2. var isFunction = require('./isFunction.js');
  3. var isArrayBuffer = require('./isArrayBuffer.js');
  4. var _stringTagBug = require('./_stringTagBug.js');
  5. var isDataView = _tagTester('DataView');
  6. // In IE 10 - Edge 13, we need a different heuristic
  7. // to determine whether an object is a `DataView`.
  8. // Also, in cases where the native `DataView` is
  9. // overridden we can't rely on the tag itself.
  10. function alternateIsDataView(obj) {
  11. return obj != null && isFunction(obj.getInt8) && isArrayBuffer(obj.buffer);
  12. }
  13. var isDataView$1 = (_stringTagBug.hasDataViewBug ? alternateIsDataView : isDataView);
  14. module.exports = isDataView$1;