main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 5 months ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
591 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var callBound = require('call-bound');
|
---|
6 |
|
---|
7 | /** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer<ArrayBufferLike>)} */
|
---|
8 | var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true);
|
---|
9 |
|
---|
10 | var isTypedArray = require('is-typed-array');
|
---|
11 |
|
---|
12 | /** @type {import('.')} */
|
---|
13 | // node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter
|
---|
14 | module.exports = $typedArrayBuffer || function typedArrayBuffer(x) {
|
---|
15 | if (!isTypedArray(x)) {
|
---|
16 | throw new $TypeError('Not a Typed Array');
|
---|
17 | }
|
---|
18 | return x.buffer;
|
---|
19 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.