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 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var callBound = require('call-bind/callBound');
|
---|
6 |
|
---|
7 | var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true);
|
---|
8 |
|
---|
9 | var 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
|
---|
13 | module.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.