@jsenv/test 3.2.0 → 3.2.1

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.
@@ -910,9 +910,7 @@ const getErrorName = (value) => {
910
910
 
911
911
  const getPropertiesFromEvalOrigin = (origin) => {
912
912
  // Most eval() calls are in this format
913
- const topLevelEvalMatch = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(
914
- origin,
915
- );
913
+ const topLevelEvalMatch = /^eval at [^(]+ \(.+:\d+:\d+\)$/.exec(origin);
916
914
  if (topLevelEvalMatch) {
917
915
  const source = topLevelEvalMatch[2];
918
916
  const line = Number(topLevelEvalMatch[3]);
@@ -924,7 +922,7 @@ const getPropertiesFromEvalOrigin = (origin) => {
924
922
  };
925
923
  }
926
924
  // Parse nested eval() calls using recursion
927
- const nestedEvalMatch = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
925
+ const nestedEvalMatch = /^eval at [^(]+ \(.+\)$/.exec(origin);
928
926
  if (nestedEvalMatch) {
929
927
  return getPropertiesFromEvalOrigin(nestedEvalMatch[2]);
930
928
  }
@@ -1,6 +1,6 @@
1
1
  import os, { cpus, release, totalmem, availableParallelism, freemem } from "node:os";
2
2
  import process$1, { cpuUsage, memoryUsage } from "node:process";
3
- import { readdir, chmod, stat, lstat, chmodSync, statSync, lstatSync, promises, readFile as readFile$1, writeFileSync as writeFileSync$1, mkdirSync, unlink, openSync, closeSync, rmdir, unlinkSync, readdirSync, rmdirSync, readFileSync, existsSync } from "node:fs";
3
+ import { readdir, chmod, stat, lstat, chmodSync, statSync, lstatSync, promises, readFile as readFile$1, readFileSync, writeFileSync as writeFileSync$1, mkdirSync, unlink, openSync, closeSync, rmdir, unlinkSync, readdirSync, rmdirSync, existsSync } from "node:fs";
4
4
  import { takeCoverage } from "node:v8";
5
5
  import stripAnsi from "strip-ansi";
6
6
  import { URL_META, createException } from "./js/exception.js";
@@ -2486,6 +2486,9 @@ const readFile = async (value, { as = "buffer" } = {}) => {
2486
2486
  const writeFileSync = (destination, content = "") => {
2487
2487
  const destinationUrl = assertAndNormalizeFileUrl(destination);
2488
2488
  const destinationUrlObject = new URL(destinationUrl);
2489
+ if (content && content instanceof URL) {
2490
+ content = readFileSync(content);
2491
+ }
2489
2492
  try {
2490
2493
  writeFileSync$1(destinationUrlObject, content);
2491
2494
  } catch (error) {
@@ -4295,7 +4298,7 @@ const stringifyUrlSite = ({ url, line, column }) => {
4295
4298
  };
4296
4299
 
4297
4300
  const replaceUrls$1 = (source, replace) => {
4298
- return source.replace(/(?:https?|ftp|file):\/\/\S+/gm, (match) => {
4301
+ return source.replace(/(?:https?|ftp|file):\/\/\S+/g, (match) => {
4299
4302
  let replacement = "";
4300
4303
  const lastChar = match[match.length - 1];
4301
4304
 
@@ -4702,7 +4705,7 @@ const formatErrorForTerminal = (
4702
4705
  // debugger
4703
4706
  // })
4704
4707
  const replaceUrls = (source, replace) => {
4705
- return source.replace(/(?:https?|ftp|file):\/\/\S+/gm, (match) => {
4708
+ return source.replace(/(?:https?|ftp|file):\/\/\S+/g, (match) => {
4706
4709
  let replacement = "";
4707
4710
  const lastChar = match[match.length - 1];
4708
4711
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,11 +38,11 @@
38
38
  "dependencies": {
39
39
  "@c88/v8-coverage": "0.1.1",
40
40
  "@jsenv/abort": "4.3.0",
41
- "@jsenv/ast": "6.1.0",
41
+ "@jsenv/ast": "6.1.1",
42
42
  "@jsenv/filesystem": "4.7.2",
43
- "@jsenv/github-check-run": "0.1.16",
43
+ "@jsenv/github-check-run": "0.1.17",
44
44
  "@jsenv/humanize": "1.1.3",
45
- "@jsenv/plugin-supervisor": "1.4.12",
45
+ "@jsenv/plugin-supervisor": "1.4.13",
46
46
  "@jsenv/url-meta": "8.4.2",
47
47
  "@jsenv/urls": "2.2.7",
48
48
  "@jsenv/utils": "2.1.1",
@@ -211,9 +211,7 @@ const getErrorName = (value) => {
211
211
 
212
212
  const getPropertiesFromEvalOrigin = (origin) => {
213
213
  // Most eval() calls are in this format
214
- const topLevelEvalMatch = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(
215
- origin,
216
- );
214
+ const topLevelEvalMatch = /^eval at [^(]+ \(.+:\d+:\d+\)$/.exec(origin);
217
215
  if (topLevelEvalMatch) {
218
216
  const source = topLevelEvalMatch[2];
219
217
  const line = Number(topLevelEvalMatch[3]);
@@ -225,7 +223,7 @@ const getPropertiesFromEvalOrigin = (origin) => {
225
223
  };
226
224
  }
227
225
  // Parse nested eval() calls using recursion
228
- const nestedEvalMatch = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
226
+ const nestedEvalMatch = /^eval at [^(]+ \(.+\)$/.exec(origin);
229
227
  if (nestedEvalMatch) {
230
228
  return getPropertiesFromEvalOrigin(nestedEvalMatch[2]);
231
229
  }
@@ -142,7 +142,7 @@ export const formatErrorForTerminal = (
142
142
  // debugger
143
143
  // })
144
144
  const replaceUrls = (source, replace) => {
145
- return source.replace(/(?:https?|ftp|file):\/\/\S+/gm, (match) => {
145
+ return source.replace(/(?:https?|ftp|file):\/\/\S+/g, (match) => {
146
146
  let replacement = "";
147
147
  const lastChar = match[match.length - 1];
148
148
 
@@ -85,7 +85,7 @@ const stringifyUrlSite = ({ url, line, column }) => {
85
85
  };
86
86
 
87
87
  const replaceUrls = (source, replace) => {
88
- return source.replace(/(?:https?|ftp|file):\/\/\S+/gm, (match) => {
88
+ return source.replace(/(?:https?|ftp|file):\/\/\S+/g, (match) => {
89
89
  let replacement = "";
90
90
  const lastChar = match[match.length - 1];
91
91