@jsenv/core 39.0.0 → 39.0.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.
package/dist/jsenv_core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readdir, chmod, stat, lstat, promises, writeFileSync as writeFileSync$1, mkdirSync, unlink, openSync, closeSync, rmdir, watch, readdirSync, statSync, createReadStream, lstatSync, readFile, existsSync,
|
|
1
|
+
import { readdir, chmod, stat, lstat, promises, readFileSync, writeFileSync as writeFileSync$1, mkdirSync, unlink, openSync, closeSync, rmdir, watch, readdirSync, statSync, createReadStream, lstatSync, readFile, existsSync, realpathSync } from "node:fs";
|
|
2
2
|
import process$1 from "node:process";
|
|
3
3
|
import os, { networkInterfaces } from "node:os";
|
|
4
4
|
import tty from "node:tty";
|
|
@@ -3233,6 +3233,9 @@ const writeDirectory = async (
|
|
|
3233
3233
|
const writeFileSync = (destination, content = "") => {
|
|
3234
3234
|
const destinationUrl = assertAndNormalizeFileUrl(destination);
|
|
3235
3235
|
const destinationUrlObject = new URL(destinationUrl);
|
|
3236
|
+
if (content && content instanceof URL) {
|
|
3237
|
+
content = readFileSync(content);
|
|
3238
|
+
}
|
|
3236
3239
|
try {
|
|
3237
3240
|
writeFileSync$1(destinationUrlObject, content);
|
|
3238
3241
|
} catch (error) {
|
|
@@ -4576,7 +4579,7 @@ const stringifyServerTimingHeader = (serverTimingHeader) => {
|
|
|
4576
4579
|
// https://www.w3.org/TR/2019/WD-server-timing-20190307/#the-server-timing-header-field
|
|
4577
4580
|
// https://tools.ietf.org/html/rfc7230#section-3.2.6
|
|
4578
4581
|
const validateServerTimingName = (name) => {
|
|
4579
|
-
const valid = /^[!#$%&'*+\-.^_`|~0-9a-z]+$/
|
|
4582
|
+
const valid = /^[!#$%&'*+\-.^_`|~0-9a-z]+$/i.test(name);
|
|
4580
4583
|
if (!valid) {
|
|
4581
4584
|
console.warn(`server timing contains invalid symbols`);
|
|
4582
4585
|
return false;
|
|
@@ -5126,7 +5129,7 @@ const onceReadableStreamUsedOrClosed = (readableStream, callback) => {
|
|
|
5126
5129
|
|
|
5127
5130
|
const normalizeHeaderName = (headerName) => {
|
|
5128
5131
|
headerName = String(headerName);
|
|
5129
|
-
if (/[^a-z0-9\-#$%&'
|
|
5132
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(headerName)) {
|
|
5130
5133
|
throw new TypeError("Invalid character in header field name");
|
|
5131
5134
|
}
|
|
5132
5135
|
|
|
@@ -13928,7 +13931,7 @@ const parseAsHashWithOptions = (token) => {
|
|
|
13928
13931
|
return { isValid, algo, base64Value, optionExpression };
|
|
13929
13932
|
};
|
|
13930
13933
|
|
|
13931
|
-
const BASE64_REGEX = /^[A-Za-z0-9
|
|
13934
|
+
const BASE64_REGEX = /^[A-Za-z0-9+/=]+$/;
|
|
13932
13935
|
const VCHAR_REGEX = /^[\x21-\x7E]+$/;
|
|
13933
13936
|
|
|
13934
13937
|
// https://www.w3.org/TR/SRI/#does-response-match-metadatalist
|
|
@@ -16425,7 +16428,7 @@ const escapeHtml = (string) => {
|
|
|
16425
16428
|
.replace(/'/g, "'");
|
|
16426
16429
|
};
|
|
16427
16430
|
const replacePlaceholders$2 = (html, replacers) => {
|
|
16428
|
-
return html.replace(
|
|
16431
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
16429
16432
|
const replacer = replacers[name];
|
|
16430
16433
|
if (replacer === undefined) {
|
|
16431
16434
|
return match;
|
|
@@ -18511,7 +18514,7 @@ const generateDirectoryContent = (
|
|
|
18511
18514
|
`);
|
|
18512
18515
|
};
|
|
18513
18516
|
const replacePlaceholders$1 = (html, replacers) => {
|
|
18514
|
-
return html.replace(
|
|
18517
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
18515
18518
|
const replacer = replacers[name];
|
|
18516
18519
|
if (replacer === undefined) {
|
|
18517
18520
|
return match;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "39.0.
|
|
3
|
+
"version": "39.0.1",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
|
|
66
66
|
"@jsenv/abort": "4.3.0",
|
|
67
|
-
"@jsenv/ast": "6.1.
|
|
67
|
+
"@jsenv/ast": "6.1.1",
|
|
68
68
|
"@jsenv/filesystem": "4.7.2",
|
|
69
69
|
"@jsenv/humanize": "1.1.3",
|
|
70
70
|
"@jsenv/importmap": "1.2.1",
|
|
71
|
-
"@jsenv/integrity": "0.0.
|
|
72
|
-
"@jsenv/js-module-fallback": "1.3.
|
|
71
|
+
"@jsenv/integrity": "0.0.2",
|
|
72
|
+
"@jsenv/js-module-fallback": "1.3.18",
|
|
73
73
|
"@jsenv/node-esm-resolution": "1.0.2",
|
|
74
74
|
"@jsenv/plugin-bundling": "2.6.12",
|
|
75
75
|
"@jsenv/plugin-minification": "1.5.4",
|
|
76
|
-
"@jsenv/plugin-supervisor": "1.4.
|
|
77
|
-
"@jsenv/plugin-transpilation": "1.4.
|
|
76
|
+
"@jsenv/plugin-supervisor": "1.4.13",
|
|
77
|
+
"@jsenv/plugin-transpilation": "1.4.1",
|
|
78
78
|
"@jsenv/runtime-compat": "1.3.0",
|
|
79
|
-
"@jsenv/server": "15.2.
|
|
79
|
+
"@jsenv/server": "15.2.9",
|
|
80
80
|
"@jsenv/sourcemap": "1.2.10",
|
|
81
81
|
"@jsenv/url-meta": "8.4.2",
|
|
82
82
|
"@jsenv/urls": "2.2.7",
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"eslint-plugin-html": "8.1.1",
|
|
105
105
|
"eslint-plugin-import": "2.29.1",
|
|
106
106
|
"eslint-plugin-react": "7.34.3",
|
|
107
|
+
"eslint-plugin-regexp": "2.6.0",
|
|
107
108
|
"open": "10.1.0",
|
|
108
109
|
"playwright": "1.45.1",
|
|
109
110
|
"prettier": "3.3.2"
|
|
@@ -366,7 +366,7 @@ const generateDirectoryContent = (
|
|
|
366
366
|
`);
|
|
367
367
|
};
|
|
368
368
|
const replacePlaceholders = (html, replacers) => {
|
|
369
|
-
return html.replace(
|
|
369
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
370
370
|
const replacer = replacers[name];
|
|
371
371
|
if (replacer === undefined) {
|
|
372
372
|
return match;
|
|
@@ -650,7 +650,7 @@ const escapeHtml = (string) => {
|
|
|
650
650
|
.replace(/'/g, "'");
|
|
651
651
|
};
|
|
652
652
|
const replacePlaceholders = (html, replacers) => {
|
|
653
|
-
return html.replace(
|
|
653
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
654
654
|
const replacer = replacers[name];
|
|
655
655
|
if (replacer === undefined) {
|
|
656
656
|
return match;
|