98a92093b52a3f6b0a820f0c7261b7a946d36bb44047850e4e270c8c78a5e9dafad07dedb9cc4e679583607632e9551832983b94c9a5523c8ff3a36e965a71 646 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var $SyntaxError = require('es-errors/syntax');
  3. var $TypeError = require('es-errors/type');
  4. var whichTypedArray = require('which-typed-array');
  5. // https://262.ecma-international.org/13.0/#sec-typedarrayelementtype
  6. var tableTAO = require('./tables/typed-array-objects');
  7. module.exports = function TypedArrayElementType(O) {
  8. var type = whichTypedArray(O);
  9. if (!type) {
  10. throw new $TypeError('Assertion failed: `O` must be a TypedArray');
  11. }
  12. var result = tableTAO.name['$' + type];
  13. if (typeof result !== 'string') {
  14. throw new $SyntaxError('Assertion failed: Unknown TypedArray type `' + type + '`');
  15. }
  16. return result;
  17. };