Files
NapCatQQ/.pnpm-store/v3/files/68/025cf051f7825da518892a681e338e19055c57af178ac4e31364c1e92a0f74a447a8566d0ae0ea9f5a21142c1c438c5b53219a9fb4be889545e9fac0333556
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

24 lines
718 B
Plaintext

'use strict';
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var isInteger = require('math-intrinsics/isInteger');
var whichTypedArray = require('which-typed-array');
// https://262.ecma-international.org/13.0/#sec-typedarrayelementsize
var tableTAO = require('./tables/typed-array-objects');
module.exports = function TypedArrayElementSize(O) {
var type = whichTypedArray(O);
if (!type) {
throw new $TypeError('Assertion failed: `O` must be a TypedArray');
}
var size = tableTAO.size['$' + tableTAO.name['$' + type]];
if (!isInteger(size) || size < 0) {
throw new $SyntaxError('Assertion failed: Unknown TypedArray type `' + type + '`');
}
return size;
};