index.js 475 B

1234567891011121314151617
  1. 'use strict';
  2. var possibleNames = require('possible-typed-array-names');
  3. var g = typeof globalThis === 'undefined' ? global : globalThis;
  4. /** @type {import('.')} */
  5. module.exports = function availableTypedArrays() {
  6. var /** @type {ReturnType<typeof availableTypedArrays>} */ out = [];
  7. for (var i = 0; i < possibleNames.length; i++) {
  8. if (typeof g[possibleNames[i]] === 'function') {
  9. // @ts-expect-error
  10. out[out.length] = possibleNames[i];
  11. }
  12. }
  13. return out;
  14. };