@jsenv/core 29.1.16 → 29.1.18

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/main.js CHANGED
@@ -11761,6 +11761,10 @@ const analyzeNewBlobCall = (node, {
11761
11761
  }) => {
11762
11762
  const firstArg = node.arguments[0];
11763
11763
 
11764
+ if (!firstArg) {
11765
+ return;
11766
+ }
11767
+
11764
11768
  if (firstArg.type !== "ArrayExpression") {
11765
11769
  return;
11766
11770
  }
@@ -29978,7 +29982,7 @@ const jsenvPluginInjectGlobals = urlAssociations => {
29978
29982
  return {
29979
29983
  name: "jsenv:inject_globals",
29980
29984
  appliesDuring: "*",
29981
- transformUrlContent: async urlInfo => {
29985
+ transformUrlContent: async (urlInfo, context) => {
29982
29986
  const url = Object.keys(urlAssociations).find(url => {
29983
29987
  return url === urlInfo.url;
29984
29988
  });
@@ -29990,7 +29994,7 @@ const jsenvPluginInjectGlobals = urlAssociations => {
29990
29994
  let globals = urlAssociations[url];
29991
29995
 
29992
29996
  if (typeof globals === "function") {
29993
- globals = await globals();
29997
+ globals = await globals(urlInfo, context);
29994
29998
  }
29995
29999
 
29996
30000
  if (Object.keys(globals).length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "29.1.16",
3
+ "version": "29.1.18",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -4,7 +4,7 @@ export const jsenvPluginInjectGlobals = (urlAssociations) => {
4
4
  return {
5
5
  name: "jsenv:inject_globals",
6
6
  appliesDuring: "*",
7
- transformUrlContent: async (urlInfo) => {
7
+ transformUrlContent: async (urlInfo, context) => {
8
8
  const url = Object.keys(urlAssociations).find((url) => {
9
9
  return url === urlInfo.url
10
10
  })
@@ -13,7 +13,7 @@ export const jsenvPluginInjectGlobals = (urlAssociations) => {
13
13
  }
14
14
  let globals = urlAssociations[url]
15
15
  if (typeof globals === "function") {
16
- globals = await globals()
16
+ globals = await globals(urlInfo, context)
17
17
  }
18
18
  if (Object.keys(globals).length === 0) {
19
19
  return null
@@ -157,6 +157,9 @@ const isNewBlobCall = (node) => {
157
157
  }
158
158
  const analyzeNewBlobCall = (node, { onInlineContentInfo }) => {
159
159
  const firstArg = node.arguments[0]
160
+ if (!firstArg) {
161
+ return
162
+ }
160
163
  if (firstArg.type !== "ArrayExpression") {
161
164
  return
162
165
  }