@jsenv/plugin-transpilation 1.3.5 → 1.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-transpilation",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "TODO",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -51,11 +51,11 @@
51
51
  "@babel/plugin-transform-template-literals": "7.22.5",
52
52
  "@babel/plugin-transform-typeof-symbol": "7.22.5",
53
53
  "@babel/plugin-transform-unicode-regex": "7.22.5",
54
- "@jsenv/ast": "5.2.0",
55
- "@jsenv/js-module-fallback": "1.3.6",
54
+ "@jsenv/ast": "6.0.0",
55
+ "@jsenv/js-module-fallback": "1.3.8",
56
56
  "@jsenv/runtime-compat": "1.2.0",
57
57
  "babel-plugin-transform-async-to-promises": "0.8.18",
58
58
  "construct-style-sheets-polyfill": "3.1.0",
59
- "lightningcss": "1.22.0"
59
+ "lightningcss": "1.22.1"
60
60
  }
61
61
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Babel helpers are copied in there to properly appear in sourcemap.
4
4
 
5
- - Last sync date: 29 September 2023
5
+ - Last sync date: 8 November 2023
6
6
 
7
7
  - Helpers file: https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers.ts
8
8
  - Individual helpers: https://github.com/babel/babel/tree/main/packages/babel-helpers/src/helpers
@@ -1,37 +1,45 @@
1
1
  function _getRequireWildcardCache(nodeInterop) {
2
- if (typeof WeakMap !== "function") return null
3
- var cacheBabelInterop = new WeakMap()
4
- var cacheNodeInterop = new WeakMap()
2
+ if (typeof WeakMap !== "function") return null;
3
+
4
+ var cacheBabelInterop = new WeakMap();
5
+ var cacheNodeInterop = new WeakMap();
5
6
  return (_getRequireWildcardCache = function (nodeInterop) {
6
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop
7
- })(nodeInterop)
7
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
8
+ })(nodeInterop);
8
9
  }
10
+
9
11
  export default function _interopRequireWildcard(obj, nodeInterop) {
10
12
  if (!nodeInterop && obj && obj.__esModule) {
11
- return obj
13
+ return obj;
12
14
  }
15
+
13
16
  if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) {
14
- return { default: obj }
17
+ return { default: obj };
15
18
  }
16
- var cache = _getRequireWildcardCache(nodeInterop)
19
+
20
+ var cache = _getRequireWildcardCache(nodeInterop);
17
21
  if (cache && cache.has(obj)) {
18
- return cache.get(obj)
22
+ return cache.get(obj);
19
23
  }
20
- var newObj = {}
21
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor
24
+
25
+ var newObj = { __proto__: null };
26
+ var hasPropertyDescriptor =
27
+ Object.defineProperty && Object.getOwnPropertyDescriptor;
22
28
  for (var key in obj) {
23
29
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
24
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null
30
+ var desc = hasPropertyDescriptor
31
+ ? Object.getOwnPropertyDescriptor(obj, key)
32
+ : null;
25
33
  if (desc && (desc.get || desc.set)) {
26
- Object.defineProperty(newObj, key, desc)
34
+ Object.defineProperty(newObj, key, desc);
27
35
  } else {
28
- newObj[key] = obj[key]
36
+ newObj[key] = obj[key];
29
37
  }
30
38
  }
31
39
  }
32
- newObj.default = obj
40
+ newObj.default = obj;
33
41
  if (cache) {
34
- cache.set(obj, newObj)
42
+ cache.set(obj, newObj);
35
43
  }
36
- return newObj
37
- }
44
+ return newObj;
45
+ }
@@ -1,4 +1,9 @@
1
- // Note: This function returns "true" for core-js functions.
2
- export default function (fn) {
3
- return Function.toString.call(fn).indexOf("[native code]") !== -1
4
- }
1
+ export default function _isNativeFunction(fn) {
2
+ // Note: This function returns "true" for core-js functions.
3
+ try {
4
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
5
+ } catch (e) {
6
+ // Firefox 31 throws when "toString" is applied to an HTMLElement
7
+ return typeof fn === "function";
8
+ }
9
+ }
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { injectQueryParams } from "@jsenv/urls";
9
9
  import {
10
- parseHtmlString,
10
+ parseHtml,
11
11
  visitHtmlNodes,
12
12
  stringifyHtmlAst,
13
13
  getHtmlNodeAttribute,
@@ -73,7 +73,7 @@ export const jsenvPluginJsModuleFallbackInsideHtml = ({
73
73
  },
74
74
  finalizeUrlContent: {
75
75
  html: async (urlInfo) => {
76
- const htmlAst = parseHtmlString(urlInfo.content);
76
+ const htmlAst = parseHtml({ html: urlInfo.content, url: urlInfo.url });
77
77
  const mutations = [];
78
78
  visitHtmlNodes(htmlAst, {
79
79
  link: (node) => {