node_modules/es-abstract/2019/GetValueFromBuffer.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2019/GetValueFromBuffer.js in immosquare-cleaner-0.1.38
- old
+ new
@@ -1,10 +1,10 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
-var $TypeError = GetIntrinsic('%TypeError%');
+var $TypeError = require('es-errors/type');
var $Uint8Array = GetIntrinsic('%Uint8Array%', true);
var callBound = require('call-bind/callBound');
var $slice = callBound('Array.prototype.slice');
@@ -16,22 +16,11 @@
var isArrayBuffer = require('is-array-buffer');
var isSharedArrayBuffer = require('is-shared-array-buffer');
var safeConcat = require('safe-array-concat');
-var table59 = {
- __proto__: null,
- $Int8: 1,
- $Uint8: 1,
- $Uint8C: 1,
- $Int16: 2,
- $Uint16: 2,
- $Int32: 4,
- $Uint32: 4,
- $Float32: 4,
- $Float64: 8
-};
+var tableTAO = require('./tables/typed-array-objects');
var defaultEndianness = require('../helpers/defaultEndianness');
// https://262.ecma-international.org/10.0/#sec-getvaluefrombuffer
@@ -71,10 +60,10 @@
throw new $TypeError('Assertion failed: `byteIndex` must be non-negative'); // step 3
}
// 4. Let block be arrayBuffer.[[ArrayBufferData]].
- var elementSize = table59['$' + type]; // step 5
+ var elementSize = tableTAO.size['$' + type]; // step 5
if (!elementSize) {
throw new $TypeError('Assertion failed: `type` must be one of "Int8", "Uint8", "Uint8C", "Int16", "Uint16", "Int32", "Uint32", "Float32", or "Float64"');
}
var rawValue;