node_modules/es-abstract/2022/GetValueFromBuffer.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2022/GetValueFromBuffer.js in immosquare-cleaner-0.1.38

- old
+ new

@@ -1,11 +1,11 @@ 'use strict'; var GetIntrinsic = require('get-intrinsic'); -var $SyntaxError = GetIntrinsic('%SyntaxError%'); -var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); var $Uint8Array = GetIntrinsic('%Uint8Array%', true); var callBound = require('call-bind/callBound'); var $slice = callBound('Array.prototype.slice'); @@ -17,24 +17,11 @@ var isArrayBuffer = require('is-array-buffer'); var isSharedArrayBuffer = require('is-shared-array-buffer'); var safeConcat = require('safe-array-concat'); -var table61 = { - __proto__: null, - $Int8: 1, - $Uint8: 1, - $Uint8C: 1, - $Int16: 2, - $Uint16: 2, - $Int32: 4, - $Uint32: 4, - $BigInt64: 8, - $BigUint64: 8, - $Float32: 4, - $Float64: 8 -}; +var tableTAO = require('./tables/typed-array-objects'); var defaultEndianness = require('../helpers/defaultEndianness'); // https://262.ecma-international.org/11.0/#sec-getvaluefrombuffer @@ -46,11 +33,11 @@ if (!isInteger(byteIndex)) { throw new $TypeError('Assertion failed: `byteIndex` must be an integer'); } - if (typeof type !== 'string' || typeof table61['$' + type] !== 'number') { + if (typeof type !== 'string' || typeof tableTAO.size['$' + type] !== 'number') { throw new $TypeError('Assertion failed: `type` must be a Typed Array element type'); } if (typeof isTypedArray !== 'boolean') { throw new $TypeError('Assertion failed: `isTypedArray` must be a boolean'); @@ -74,10 +61,10 @@ throw new $TypeError('Assertion failed: `byteIndex` must be non-negative'); // step 3 } // 4. Let block be arrayBuffer.[[ArrayBufferData]]. - var elementSize = table61['$' + 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", "BigInt64", "BigUint64", "Float32", or "Float64"'); } var rawValue;