@jsenv/js-module-fallback 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/s.js CHANGED
@@ -1,28 +1,3 @@
1
- function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
2
- // https://mathiasbynens.be/notes/globalthis
3
-
4
- /* eslint-disable no-redeclare */
5
- /* global globalThis */
6
- var globalObject;
7
- if ((typeof globalThis === "undefined" ? "undefined" : _typeof2(globalThis)) === "object") {
8
- globalObject = globalThis;
9
- } else {
10
- if (_typeof2(this) === "object") {
11
- globalObject = this;
12
- } else {
13
- // eslint-disable-next-line no-extend-native
14
- Object.defineProperty(Object.prototype, "__global__", {
15
- get: function get() {
16
- return this;
17
- },
18
- configurable: true
19
- });
20
- // eslint-disable-next-line no-undef
21
- globalObject = __global__;
22
- delete Object.prototype.__global__;
23
- }
24
- globalObject.globalThis = globalObject;
25
- }
26
1
  (function (global, factory) {
27
2
  if (typeof define === "function" && define.amd) {
28
3
  define([], factory);
@@ -38,104 +13,6 @@ if ((typeof globalThis === "undefined" ? "undefined" : _typeof2(globalThis)) ===
38
13
  })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function () {
39
14
  "use strict";
40
15
 
41
- // eslint-disable-next-line consistent-return
42
- var arrayWithHoles = function arrayWithHoles(arr) {
43
- if (Array.isArray(arr)) return arr;
44
- };
45
-
46
- /* @minVersion 7.0.0-beta.0 */
47
-
48
- function _iterableToArrayLimit(arr, i) {
49
- // this is an expanded form of \`for...of\` that properly supports abrupt completions of
50
- // iterators etc. variable names have been minimised to reduce the size of this massive
51
- // helper. sometimes spec compliance is annoying :(
52
- //
53
- // _n = _iteratorNormalCompletion
54
- // _d = _didIteratorError
55
- // _e = _iteratorError
56
- // _i = _iterator
57
- // _s = _step
58
- // _x = _next
59
- // _r = _return
60
-
61
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
62
- if (_i == null) return;
63
- var _arr = [];
64
- var _n = true;
65
- var _d = false;
66
- var _s, _e, _x, _r;
67
- try {
68
- _x = (_i = _i.call(arr)).next;
69
- if (i === 0) {
70
- if (Object(_i) !== _i) return;
71
- _n = false;
72
- } else {
73
- for (; !(_n = (_s = _x.call(_i)).done); _n = true) {
74
- _arr.push(_s.value);
75
- if (_arr.length === i) break;
76
- }
77
- }
78
- } catch (err) {
79
- _d = true;
80
- _e = err;
81
- } finally {
82
- try {
83
- if (!_n && _i["return"] != null) {
84
- _r = _i["return"]();
85
- // eslint-disable-next-line no-unsafe-finally
86
- if (Object(_r) !== _r) return;
87
- }
88
- } finally {
89
- // eslint-disable-next-line no-unsafe-finally
90
- if (_d) throw _e;
91
- }
92
- }
93
- return _arr;
94
- }
95
-
96
- /* eslint-disable no-eq-null, eqeqeq */
97
- function arrayLikeToArray(arr, len) {
98
- if (len == null || len > arr.length) len = arr.length;
99
- var arr2 = new Array(len);
100
- for (var i = 0; i < len; i++) arr2[i] = arr[i];
101
- return arr2;
102
- }
103
-
104
- /* eslint-disable consistent-return */
105
- function unsupportedIterableToArray(o, minLen) {
106
- if (!o) return;
107
- if (typeof o === "string") return arrayLikeToArray(o, minLen);
108
- var n = Object.prototype.toString.call(o).slice(8, -1);
109
- if (n === "Object" && o.constructor) n = o.constructor.name;
110
- if (n === "Map" || n === "Set") return Array.from(o);
111
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
112
- }
113
- var nonIterableRest = function nonIterableRest() {
114
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
115
- };
116
- var _slicedToArray = function _slicedToArray(arr, i) {
117
- return arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
118
- };
119
- var nativeTypeOf = function nativeTypeOf(obj) {
120
- return _typeof2(obj);
121
- };
122
- var customTypeOf = function customTypeOf(obj) {
123
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
124
- };
125
- var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? nativeTypeOf : customTypeOf;
126
-
127
- /*
128
- * This file is a modified version of https://github.com/systemjs/systemjs/blob/main/dist/s.js
129
- * with the following changes:
130
- *
131
- * - Code can use aync/await, const, etc because this file is compiled (see dist/s.js)
132
- * - Can use document.currentScript because we don't support IE
133
- * - auto import inline System.register
134
- * - auto import first System.register in web workers
135
- * - queing events in web workers
136
- * - no support for importmap because jsenv don't need it
137
- */
138
-
139
16
  function _await(value, then, direct) {
140
17
  if (direct) {
141
18
  return then ? then(value) : value;
@@ -181,6 +58,76 @@ if ((typeof globalThis === "undefined" ? "undefined" : _typeof2(globalThis)) ===
181
58
  }
182
59
  return result;
183
60
  }
61
+ function _slicedToArray(arr, i) {
62
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
63
+ }
64
+ function _nonIterableRest() {
65
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
66
+ }
67
+ function _unsupportedIterableToArray(o, minLen) {
68
+ if (!o) return;
69
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
70
+ var n = Object.prototype.toString.call(o).slice(8, -1);
71
+ if (n === "Object" && o.constructor) n = o.constructor.name;
72
+ if (n === "Map" || n === "Set") return Array.from(o);
73
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
74
+ }
75
+ function _arrayLikeToArray(arr, len) {
76
+ if (len == null || len > arr.length) len = arr.length;
77
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
78
+ return arr2;
79
+ }
80
+ function _iterableToArrayLimit(arr, i) {
81
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
82
+ if (null != _i) {
83
+ var _s,
84
+ _e,
85
+ _x,
86
+ _r,
87
+ _arr = [],
88
+ _n = !0,
89
+ _d = !1;
90
+ try {
91
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
92
+ if (Object(_i) !== _i) return;
93
+ _n = !1;
94
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
95
+ } catch (err) {
96
+ _d = !0, _e = err;
97
+ } finally {
98
+ try {
99
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
100
+ } finally {
101
+ if (_d) throw _e;
102
+ }
103
+ }
104
+ return _arr;
105
+ }
106
+ }
107
+ function _arrayWithHoles(arr) {
108
+ if (Array.isArray(arr)) return arr;
109
+ }
110
+ function _typeof(obj) {
111
+ "@babel/helpers - typeof";
112
+
113
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
114
+ return typeof obj;
115
+ } : function (obj) {
116
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
117
+ }, _typeof(obj);
118
+ }
119
+ /*
120
+ * This file is a modified version of https://github.com/systemjs/systemjs/blob/main/dist/s.js
121
+ * with the following changes:
122
+ *
123
+ * - Code can use aync/await, const, etc because this file is compiled (see dist/s.js)
124
+ * - Can use document.currentScript because we don't support IE
125
+ * - auto import inline System.register
126
+ * - auto import first System.register in web workers
127
+ * - queing events in web workers
128
+ * - no support for importmap because jsenv don't need it
129
+ */
130
+
184
131
  (function () {
185
132
  /* eslint-env browser */
186
133