Skip to content

Instantly share code, notes, and snippets.

@methyl
Created August 3, 2020 12:06
Show Gist options
  • Save methyl/cf60359717ca17ded0ea779dd0a4083f to your computer and use it in GitHub Desktop.
Save methyl/cf60359717ca17ded0ea779dd0a4083f to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
function _loadWasmModule (sync, src, imports) {
var buf = null
var isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null
if (isNode) {
buf = Buffer.from(src, 'base64')
} else {
var raw = globalThis.atob(src)
var rawLength = raw.length
buf = new Uint8Array(new ArrayBuffer(rawLength))
for(var i = 0; i < rawLength; i++) {
buf[i] = raw.charCodeAt(i)
}
}
if (imports && !sync) {
return WebAssembly.instantiate(buf, imports)
} else if (!imports && !sync) {
return WebAssembly.compile(buf)
} else {
var mod = new WebAssembly.Module(buf)
return imports ? new WebAssembly.Instance(mod, imports) : mod
}
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@babel/runtime/regenerator'), require('@babel/runtime/helpers/slicedToArray'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/asyncToGenerator'), require('fast-text-encoding')) :
typeof define === 'function' && define.amd ? define(['@babel/runtime/regenerator', '@babel/runtime/helpers/slicedToArray', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/asyncToGenerator', 'fast-text-encoding'], factory) :
(global = global || self, global.IntlSegmenterPolyfillBundled = factory(global._regeneratorRuntime, global._slicedToArray, global._classCallCheck, global._createClass, global._asyncToGenerator));
}(this, (function (_regeneratorRuntime, _slicedToArray, _classCallCheck, _createClass, _asyncToGenerator) { 'use strict';
_regeneratorRuntime = _regeneratorRuntime && Object.prototype.hasOwnProperty.call(_regeneratorRuntime, 'default') ? _regeneratorRuntime['default'] : _regeneratorRuntime;
_slicedToArray = _slicedToArray && Object.prototype.hasOwnProperty.call(_slicedToArray, 'default') ? _slicedToArray['default'] : _slicedToArray;
_classCallCheck = _classCallCheck && Object.prototype.hasOwnProperty.call(_classCallCheck, 'default') ? _classCallCheck['default'] : _classCallCheck;
_createClass = _createClass && Object.prototype.hasOwnProperty.call(_createClass, 'default') ? _createClass['default'] : _createClass;
_asyncToGenerator = _asyncToGenerator && Object.prototype.hasOwnProperty.call(_asyncToGenerator, 'default') ? _asyncToGenerator['default'] : _asyncToGenerator;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment