@jsenv/test 3.3.26 → 3.3.28

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.
@@ -519,7 +519,7 @@ const isWindowsPathnameSpecifier = (specifier) => {
519
519
  };
520
520
  const hasScheme = (specifier) => /^[a-zA-Z]+:/.test(specifier);
521
521
 
522
- const createFilter = (patterns, url) => {
522
+ const createFilter = (patterns, url, map = (v) => v) => {
523
523
  const associations = resolveAssociations(
524
524
  {
525
525
  yes: patterns,
@@ -528,7 +528,7 @@ const createFilter = (patterns, url) => {
528
528
  );
529
529
  return (url) => {
530
530
  const meta = applyAssociations({ url, associations });
531
- return Boolean(meta.yes);
531
+ return Boolean(map(meta.yes));
532
532
  };
533
533
  };
534
534
 
@@ -8102,7 +8102,7 @@ const CONTROLLED_CHILD_PROCESS_URL = new URL(
8102
8102
 
8103
8103
  const nodeChildProcess = ({
8104
8104
  logProcessCommand = false,
8105
- importMap,
8105
+ importmap,
8106
8106
  gracefulStopAllocatedMs = 4000,
8107
8107
  env,
8108
8108
  debugPort,
@@ -8165,8 +8165,8 @@ const nodeChildProcess = ({
8165
8165
  commandLineOptions.push("--expose-gc");
8166
8166
  }
8167
8167
  }
8168
- if (importMap) {
8169
- env.IMPORT_MAP = JSON.stringify(importMap);
8168
+ if (importmap) {
8169
+ env.IMPORT_MAP = JSON.stringify(importmap);
8170
8170
  env.IMPORT_MAP_BASE_URL = rootDirectoryUrl;
8171
8171
  commandLineOptions.push(
8172
8172
  `--experimental-loader=${IMPORTMAP_NODE_LOADER_FILE_URL}`,
@@ -8581,8 +8581,14 @@ const CONTROLLED_WORKER_THREAD_URL = new URL(
8581
8581
  import.meta.url,
8582
8582
  ).href;
8583
8583
 
8584
+ /**
8585
+ * Create a runtime object capable to execute a file with Node.js
8586
+ * @param {Object} nodeWorkerThreadParameters
8587
+ * @param {string|url} nodeWorkerThreadParameters.importmap
8588
+ * An object to remap import
8589
+ */
8584
8590
  const nodeWorkerThread = ({
8585
- importMap,
8591
+ importmap,
8586
8592
  env,
8587
8593
  debugPort,
8588
8594
  debugMode,
@@ -8631,8 +8637,8 @@ const nodeWorkerThread = ({
8631
8637
  if (onMeasureMemoryAvailable) {
8632
8638
  env.MEASURE_MEMORY_AT_START = "1";
8633
8639
  }
8634
- if (importMap) {
8635
- env.IMPORT_MAP = JSON.stringify(importMap);
8640
+ if (importmap) {
8641
+ env.IMPORT_MAP = JSON.stringify(importmap);
8636
8642
  env.IMPORT_MAP_BASE_URL = rootDirectoryUrl;
8637
8643
  commandLineOptions.push(`--import=${IMPORTMAP_NODE_LOADER_FILE_URL}`);
8638
8644
  commandLineOptions.push(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "3.3.26",
3
+ "version": "3.3.28",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,14 +38,14 @@
38
38
  "dependencies": {
39
39
  "@c88/v8-coverage": "0.1.1",
40
40
  "@jsenv/abort": "4.3.0",
41
- "@jsenv/ast": "6.2.13",
42
- "@jsenv/exception": "1.0.1",
43
- "@jsenv/filesystem": "4.9.9",
44
- "@jsenv/github-check-run": "0.1.30",
41
+ "@jsenv/ast": "6.2.14",
42
+ "@jsenv/exception": "1.0.2",
43
+ "@jsenv/filesystem": "4.9.10",
44
+ "@jsenv/github-check-run": "0.1.31",
45
45
  "@jsenv/humanize": "1.2.8",
46
- "@jsenv/plugin-supervisor": "1.5.14",
46
+ "@jsenv/plugin-supervisor": "1.5.15",
47
47
  "@jsenv/sourcemap": "1.2.22",
48
- "@jsenv/url-meta": "8.5.0",
48
+ "@jsenv/url-meta": "8.5.1",
49
49
  "@jsenv/urls": "2.5.2",
50
50
  "@jsenv/utils": "2.1.2",
51
51
  "he": "1.2.0",
@@ -18,7 +18,7 @@ const CONTROLLED_CHILD_PROCESS_URL = new URL(
18
18
 
19
19
  export const nodeChildProcess = ({
20
20
  logProcessCommand = false,
21
- importMap,
21
+ importmap,
22
22
  gracefulStopAllocatedMs = 4000,
23
23
  env,
24
24
  debugPort,
@@ -81,8 +81,8 @@ export const nodeChildProcess = ({
81
81
  commandLineOptions.push("--expose-gc");
82
82
  }
83
83
  }
84
- if (importMap) {
85
- env.IMPORT_MAP = JSON.stringify(importMap);
84
+ if (importmap) {
85
+ env.IMPORT_MAP = JSON.stringify(importmap);
86
86
  env.IMPORT_MAP_BASE_URL = rootDirectoryUrl;
87
87
  commandLineOptions.push(
88
88
  `--experimental-loader=${IMPORTMAP_NODE_LOADER_FILE_URL}`,
@@ -18,8 +18,14 @@ const CONTROLLED_WORKER_THREAD_URL = new URL(
18
18
  import.meta.url,
19
19
  ).href;
20
20
 
21
+ /**
22
+ * Create a runtime object capable to execute a file with Node.js
23
+ * @param {Object} nodeWorkerThreadParameters
24
+ * @param {string|url} nodeWorkerThreadParameters.importmap
25
+ * An object to remap import
26
+ */
21
27
  export const nodeWorkerThread = ({
22
- importMap,
28
+ importmap,
23
29
  env,
24
30
  debugPort,
25
31
  debugMode,
@@ -68,8 +74,8 @@ export const nodeWorkerThread = ({
68
74
  if (onMeasureMemoryAvailable) {
69
75
  env.MEASURE_MEMORY_AT_START = "1";
70
76
  }
71
- if (importMap) {
72
- env.IMPORT_MAP = JSON.stringify(importMap);
77
+ if (importmap) {
78
+ env.IMPORT_MAP = JSON.stringify(importmap);
73
79
  env.IMPORT_MAP_BASE_URL = rootDirectoryUrl;
74
80
  commandLineOptions.push(`--import=${IMPORTMAP_NODE_LOADER_FILE_URL}`);
75
81
  commandLineOptions.push(