es-module-shims 1.3.5 → 1.3.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ES Module Shims 1.3.6 (2021/12/07)
2
+ * Fix resolve hook via esms options (#233, @ffortier)
3
+
1
4
  ES Module Shims 1.3.5 (2021/12/02)
2
5
  * Fix trailing comment regex for source mapping normalization with trailling comments (https://github.com/guybedford/es-module-shims/pull/231)
3
6
 
@@ -1,4 +1,4 @@
1
- /* ES Module Shims 1.3.5 */
1
+ /* ES Module Shims 1.3.6 */
2
2
  (function () {
3
3
 
4
4
  const edge = navigator.userAgent.match(/Edge\/\d\d\.\d+$/);
@@ -199,14 +199,14 @@
199
199
 
200
200
  const optionsScript = document.querySelector('script[type=esms-options]');
201
201
 
202
- const esmsInitOptions$1 = optionsScript ? JSON.parse(optionsScript.innerHTML) : self.esmsInitOptions ? self.esmsInitOptions : {};
202
+ const esmsInitOptions = optionsScript ? JSON.parse(optionsScript.innerHTML) : self.esmsInitOptions ? self.esmsInitOptions : {};
203
203
 
204
- let shimMode = !!esmsInitOptions$1.shimMode;
205
- const resolveHook = globalHook(shimMode && esmsInitOptions$1.resolve);
204
+ let shimMode = !!esmsInitOptions.shimMode;
205
+ const resolveHook = globalHook(shimMode && esmsInitOptions.resolve);
206
206
 
207
- const skip = esmsInitOptions$1.skip ? new RegExp(esmsInitOptions$1.skip) : null;
207
+ const skip = esmsInitOptions.skip ? new RegExp(esmsInitOptions.skip) : null;
208
208
 
209
- let nonce = esmsInitOptions$1.nonce;
209
+ let nonce = esmsInitOptions.nonce;
210
210
 
211
211
  if (!nonce) {
212
212
  const nonceElement = document.querySelector('script[nonce]');
@@ -214,18 +214,18 @@
214
214
  nonce = nonceElement.nonce || nonceElement.getAttribute('nonce');
215
215
  }
216
216
 
217
- const onerror = globalHook(esmsInitOptions$1.onerror || noop);
218
- const onpolyfill = globalHook(esmsInitOptions$1.onpolyfill || noop);
217
+ const onerror = globalHook(esmsInitOptions.onerror || noop);
218
+ const onpolyfill = globalHook(esmsInitOptions.onpolyfill || noop);
219
219
 
220
- const { revokeBlobURLs, noLoadEventRetriggers } = esmsInitOptions$1;
220
+ const { revokeBlobURLs, noLoadEventRetriggers } = esmsInitOptions;
221
221
 
222
- const fetchHook = esmsInitOptions$1.fetch ? globalHook(esmsInitOptions$1.fetch) : fetch;
222
+ const fetchHook = esmsInitOptions.fetch ? globalHook(esmsInitOptions.fetch) : fetch;
223
223
 
224
224
  function globalHook (name) {
225
225
  return typeof name === 'string' ? self[name] : name;
226
226
  }
227
227
 
228
- const enable = Array.isArray(esmsInitOptions$1.polyfillEnable) ? esmsInitOptions$1.polyfillEnable : [];
228
+ const enable = Array.isArray(esmsInitOptions.polyfillEnable) ? esmsInitOptions.polyfillEnable : [];
229
229
  const cssModulesEnabled = enable.includes('css-modules');
230
230
  const jsonModulesEnabled = enable.includes('json-modules');
231
231
 
@@ -318,7 +318,7 @@
318
318
  };
319
319
  }
320
320
 
321
- const resolve = resolveHook ? async (id, parentUrl) => ({ r: await esmsInitOptions.resolve(id, parentUrl, defaultResolve), b: false }) : _resolve;
321
+ const resolve = resolveHook ? async (id, parentUrl) => ({ r: await resolveHook(id, parentUrl, defaultResolve), b: false }) : _resolve;
322
322
 
323
323
  let id = 0;
324
324
  const registry = {};
@@ -1,4 +1,4 @@
1
- /* ES Module Shims Wasm 1.3.5 */
1
+ /* ES Module Shims Wasm 1.3.6 */
2
2
  (function () {
3
3
 
4
4
  const edge = navigator.userAgent.match(/Edge\/\d\d\.\d+$/);
@@ -199,14 +199,14 @@
199
199
 
200
200
  const optionsScript = document.querySelector('script[type=esms-options]');
201
201
 
202
- const esmsInitOptions$1 = optionsScript ? JSON.parse(optionsScript.innerHTML) : self.esmsInitOptions ? self.esmsInitOptions : {};
202
+ const esmsInitOptions = optionsScript ? JSON.parse(optionsScript.innerHTML) : self.esmsInitOptions ? self.esmsInitOptions : {};
203
203
 
204
- let shimMode = !!esmsInitOptions$1.shimMode;
205
- const resolveHook = globalHook(shimMode && esmsInitOptions$1.resolve);
204
+ let shimMode = !!esmsInitOptions.shimMode;
205
+ const resolveHook = globalHook(shimMode && esmsInitOptions.resolve);
206
206
 
207
- const skip = esmsInitOptions$1.skip ? new RegExp(esmsInitOptions$1.skip) : null;
207
+ const skip = esmsInitOptions.skip ? new RegExp(esmsInitOptions.skip) : null;
208
208
 
209
- let nonce = esmsInitOptions$1.nonce;
209
+ let nonce = esmsInitOptions.nonce;
210
210
 
211
211
  if (!nonce) {
212
212
  const nonceElement = document.querySelector('script[nonce]');
@@ -214,18 +214,18 @@
214
214
  nonce = nonceElement.nonce || nonceElement.getAttribute('nonce');
215
215
  }
216
216
 
217
- const onerror = globalHook(esmsInitOptions$1.onerror || noop);
218
- const onpolyfill = globalHook(esmsInitOptions$1.onpolyfill || noop);
217
+ const onerror = globalHook(esmsInitOptions.onerror || noop);
218
+ const onpolyfill = globalHook(esmsInitOptions.onpolyfill || noop);
219
219
 
220
- const { revokeBlobURLs, noLoadEventRetriggers } = esmsInitOptions$1;
220
+ const { revokeBlobURLs, noLoadEventRetriggers } = esmsInitOptions;
221
221
 
222
- const fetchHook = esmsInitOptions$1.fetch ? globalHook(esmsInitOptions$1.fetch) : fetch;
222
+ const fetchHook = esmsInitOptions.fetch ? globalHook(esmsInitOptions.fetch) : fetch;
223
223
 
224
224
  function globalHook (name) {
225
225
  return typeof name === 'string' ? self[name] : name;
226
226
  }
227
227
 
228
- const enable = Array.isArray(esmsInitOptions$1.polyfillEnable) ? esmsInitOptions$1.polyfillEnable : [];
228
+ const enable = Array.isArray(esmsInitOptions.polyfillEnable) ? esmsInitOptions.polyfillEnable : [];
229
229
  const cssModulesEnabled = enable.includes('css-modules');
230
230
  const jsonModulesEnabled = enable.includes('json-modules');
231
231
 
@@ -316,7 +316,7 @@
316
316
  };
317
317
  }
318
318
 
319
- const resolve = resolveHook ? async (id, parentUrl) => ({ r: await esmsInitOptions.resolve(id, parentUrl, defaultResolve), b: false }) : _resolve;
319
+ const resolve = resolveHook ? async (id, parentUrl) => ({ r: await resolveHook(id, parentUrl, defaultResolve), b: false }) : _resolve;
320
320
 
321
321
  let id = 0;
322
322
  const registry = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-module-shims",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Shims for the latest ES module features",
5
5
  "main": "dist/es-module-shims.js",
6
6
  "exports": {