source: imaps-frontend/node_modules/typed-array-buffer/index.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 510 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var callBound = require('call-bind/callBound');
6
7var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true);
8
9var isTypedArray = require('is-typed-array');
10
11/** @type {import('.')} */
12// node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter
13module.exports = $typedArrayBuffer || function typedArrayBuffer(x) {
14 if (!isTypedArray(x)) {
15 throw new $TypeError('Not a Typed Array');
16 }
17 return x.buffer;
18};
Note: See TracBrowser for help on using the repository browser.