3a48a98e6e85a4f41e4e17a564fe5bc56799df036bf4b001f1ba050bc888fb2a38489186c6a3e1b3825e9d9c5d343f777663240b4cfebdf6a4392a2b1ad401 591 B

12345678910111213141516171819
  1. 'use strict';
  2. var $TypeError = require('es-errors/type');
  3. var callBound = require('call-bound');
  4. /** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer<ArrayBufferLike>)} */
  5. var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true);
  6. var isTypedArray = require('is-typed-array');
  7. /** @type {import('.')} */
  8. // node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter
  9. module.exports = $typedArrayBuffer || function typedArrayBuffer(x) {
  10. if (!isTypedArray(x)) {
  11. throw new $TypeError('Not a Typed Array');
  12. }
  13. return x.buffer;
  14. };