vike 0.4.229-commit-e1ca16d → 0.4.230-commit-8b60b8c
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/cjs/node/api/build.js +1 -0
- package/dist/cjs/node/plugin/onLoad.js +2 -0
- package/dist/cjs/node/plugin/plugins/build/pluginDistFileNames.js +1 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/assertExtensions.js +2 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/getPlusFilesAll.js +5 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +0 -2
- package/dist/cjs/node/runtime/html/serializeContext.js +3 -1
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +1 -1
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +0 -2
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/isDev.js +3 -1
- package/dist/cjs/utils/parseUrl-extras.js +0 -1
- package/dist/esm/node/api/build.js +1 -0
- package/dist/esm/node/plugin/onLoad.js +2 -0
- package/dist/esm/node/plugin/plugins/build/pluginDistFileNames.js +1 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/assertExtensions.d.ts +1 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/assertExtensions.js +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/getPlusFilesAll.js +6 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +0 -2
- package/dist/esm/node/runtime/html/serializeContext.js +3 -1
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +1 -1
- package/dist/esm/node/runtime/renderPage/resolveRedirects.d.ts +0 -2
- package/dist/esm/node/runtime/renderPage/resolveRedirects.js +0 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/isDev.js +3 -1
- package/dist/esm/utils/parseUrl-extras.js +0 -1
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ async function build(options = {}) {
|
|
|
17
17
|
if (viteConfigFromUserEnhanced)
|
|
18
18
|
viteConfigFromUserEnhanced._viteConfigFromUserEnhanced = viteConfigFromUserEnhanced;
|
|
19
19
|
if (vikeConfig.global.config.vite6BuilderApp) {
|
|
20
|
+
// This assertion isn't reliable: the user may still use a Vite version older than 6.0.0 — see https://github.com/vitejs/vite/pull/19355
|
|
20
21
|
(0, utils_js_1.assertVersion)('Vite', vite_1.version, '6.0.0');
|
|
21
22
|
const builder = await (0, vite_1.createBuilder)(viteConfigFromUserEnhanced);
|
|
22
23
|
// See Vite plugin vike:build:pluginBuildApp
|
|
@@ -11,6 +11,8 @@ function onLoad() {
|
|
|
11
11
|
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
12
12
|
(0, assertNodeVersion_js_1.assertNodeVersion)();
|
|
13
13
|
// package.json#peerDependencies isn't enough as users often ignore it
|
|
14
|
+
// This assertion isn't reliable: the user may still use a Vite version older than 5.1.0 — see https://github.com/vitejs/vite/pull/19355
|
|
15
|
+
// TO-DO/soon: let's also use this.meta.viteVersion https://github.com/vitejs/vite/pull/20088
|
|
14
16
|
(0, assertVersion_js_1.assertVersion)('Vite', vite_1.version, '5.1.0');
|
|
15
17
|
// Ensure we don't bloat the server runtime with heavy dependencies such Vite and esbuild
|
|
16
18
|
(0, assertSetup_js_1.assertIsNotProductionRuntime)();
|
|
@@ -52,6 +52,7 @@ function pluginDistFileNames() {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
// Disable CSS bundling to workaround https://github.com/vikejs/vike/issues/1815
|
|
55
|
+
// TO-DO/eventually: let's bundle CSS again once Rolldown replaces Rollup
|
|
55
56
|
if (id.endsWith('.css')) {
|
|
56
57
|
const userRootDir = config.root;
|
|
57
58
|
if (id.startsWith(userRootDir)) {
|
package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/assertExtensions.js
CHANGED
|
@@ -33,8 +33,8 @@ function assertExtensionName(plusFile) {
|
|
|
33
33
|
const name = getNameValue(plusFile);
|
|
34
34
|
(0, utils_js_1.assertUsage)(name, `Vike extension name missing: the config ${filePathToShowToUser} must define the setting ${picocolors_1.default.cyan('name')}`);
|
|
35
35
|
}
|
|
36
|
-
function assertExtensionsRequire(
|
|
37
|
-
const plusFilesRelevantList =
|
|
36
|
+
function assertExtensionsRequire(plusFiles) {
|
|
37
|
+
const plusFilesRelevantList = plusFiles;
|
|
38
38
|
// Collect extensions
|
|
39
39
|
const extensions = {};
|
|
40
40
|
plusFilesRelevantList.forEach((plusFile) => {
|
package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/getPlusFilesAll.js
CHANGED
|
@@ -82,8 +82,13 @@ async function getPlusFilesAll(userRootDir, esbuildCache) {
|
|
|
82
82
|
Object.entries(plusFilesAll).forEach(([_locationId, plusFiles]) => {
|
|
83
83
|
plusFiles.sort(sortMakeDeterministic);
|
|
84
84
|
});
|
|
85
|
+
assertPlusFiles(plusFilesAll);
|
|
85
86
|
return plusFilesAll;
|
|
86
87
|
}
|
|
88
|
+
function assertPlusFiles(plusFilesAll) {
|
|
89
|
+
const plusFiles = Object.values(plusFilesAll).flat();
|
|
90
|
+
(0, assertExtensions_js_1.assertExtensionsRequire)(plusFiles);
|
|
91
|
+
}
|
|
87
92
|
function getPlusFileFromConfigFile(configFile, isExtensionConfig, locationId, userRootDir) {
|
|
88
93
|
const { fileExports, filePath, extendsFilePaths } = configFile;
|
|
89
94
|
const fileExportsByConfigName = {};
|
|
@@ -25,7 +25,6 @@ const loadFileAtConfigTime_js_1 = require("./getVikeConfig/loadFileAtConfigTime.
|
|
|
25
25
|
const resolvePointerImport_js_1 = require("./getVikeConfig/resolvePointerImport.js");
|
|
26
26
|
const getFilePath_js_1 = require("../../../shared/getFilePath.js");
|
|
27
27
|
const getConfigValueBuildTime_js_1 = require("../../../../../shared/page-configs/getConfigValueBuildTime.js");
|
|
28
|
-
const assertExtensions_js_1 = require("./getVikeConfig/assertExtensions.js");
|
|
29
28
|
const getUserFriendlyConfigs_js_1 = require("../../../../../shared/page-configs/getUserFriendlyConfigs.js");
|
|
30
29
|
const serializeConfigValues_js_1 = require("../../../../../shared/page-configs/serialize/serializeConfigValues.js");
|
|
31
30
|
const getPlusFilesAll_js_1 = require("./getVikeConfig/getPlusFilesAll.js");
|
|
@@ -327,7 +326,6 @@ function assertGlobalConfigLocation(configName, sources, plusFilesAll, configDef
|
|
|
327
326
|
}
|
|
328
327
|
function assertPageConfigs(pageConfigs) {
|
|
329
328
|
pageConfigs.forEach((pageConfig) => {
|
|
330
|
-
(0, assertExtensions_js_1.assertExtensionsRequire)(pageConfig);
|
|
331
329
|
assertOnBeforeRenderEnv(pageConfig);
|
|
332
330
|
});
|
|
333
331
|
}
|
|
@@ -71,7 +71,9 @@ function serializeObject(obj, objName, passToClient) {
|
|
|
71
71
|
if ((0, stringify_1.isJsonSerializerError)(err)) {
|
|
72
72
|
pathString = err.pathString;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
// There used to be a `## Serialization Error` section in the docs but we removed it at:
|
|
75
|
+
// https://github.com/vikejs/vike/commit/c9da2f577db01bd1c8f72265ff83e78484ddc2c0
|
|
76
|
+
(0, utils_js_1.assertUsage)(false, `Cannot serialize config value ${h(pathString)} set by useConfig()`);
|
|
75
77
|
}
|
|
76
78
|
// Non-serializable property set by the user
|
|
77
79
|
let msg = [
|
|
@@ -105,7 +105,7 @@ function getHttpResponseBodyStreamHandlers(htmlRender, renderHook) {
|
|
|
105
105
|
(0, utils_js_1.assert)(['a ', 'an ', 'the '].some((s) => streamName.startsWith(s)));
|
|
106
106
|
(0, utils_js_1.assert)(renderHook);
|
|
107
107
|
const { hookFilePath, hookName } = renderHook;
|
|
108
|
-
return `Make sure the ${hookName}() defined by ${hookFilePath}
|
|
108
|
+
return `Make sure the ${hookName}() hook defined by ${hookFilePath} provides ${streamName} instead`;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
function getErrMsg(htmlRender, renderHook, method, msgAddendum) {
|
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.redirectsErrPrefix = void 0;
|
|
7
6
|
exports.resolveRedirects = resolveRedirects;
|
|
8
7
|
exports.resolveRouteStringRedirect = resolveRouteStringRedirect;
|
|
9
8
|
const assertIsNotBrowser_js_1 = require("../../../utils/assertIsNotBrowser.js");
|
|
@@ -13,7 +12,6 @@ const resolveRouteString_js_1 = require("../../../shared/route/resolveRouteStrin
|
|
|
13
12
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
14
13
|
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)(); // Don't bloat the client
|
|
15
14
|
const redirectsErrPrefix = '[+redirects]';
|
|
16
|
-
exports.redirectsErrPrefix = redirectsErrPrefix;
|
|
17
15
|
function resolveRedirects(redirectsAll, urlPathname) {
|
|
18
16
|
const redirects = merge(redirectsAll);
|
|
19
17
|
for (const [urlSource, urlTarget] of Object.entries(redirects)) {
|
package/dist/cjs/utils/isDev.js
CHANGED
|
@@ -6,7 +6,9 @@ exports.applyPreview = applyPreview;
|
|
|
6
6
|
const assert_js_1 = require("./assert.js");
|
|
7
7
|
function isDevCheck(configEnv) {
|
|
8
8
|
const { isPreview, command } = configEnv;
|
|
9
|
-
//
|
|
9
|
+
// Note that:
|
|
10
|
+
// - `assertVersion('Vite', version, '5.1.0')` at node/plugin/onLoad.ts isn't enough: https://github.com/vitejs/vite/pull/19355
|
|
11
|
+
// - We'll eventually be able to make this an assert() instead of assertUsage() once Vike requires a Vite version that supports this.meta.viteVersion
|
|
10
12
|
(0, assert_js_1.assertUsage)(typeof isPreview === 'boolean', 'You are using an old Vite version; make sure to use Vite 5.1.0 or above.');
|
|
11
13
|
return command === 'serve' && !isPreview;
|
|
12
14
|
}
|
|
@@ -94,7 +94,6 @@ function modifyUrlPathname(url, modifier) {
|
|
|
94
94
|
function removeUrlOrigin(url) {
|
|
95
95
|
const { origin, pathnameOriginal, searchOriginal, hashOriginal } = (0, parseUrl_js_1.parseUrl)(url, '/');
|
|
96
96
|
const urlModified = (0, parseUrl_js_1.createUrlFromComponents)(null, pathnameOriginal, searchOriginal, hashOriginal);
|
|
97
|
-
(0, assert_js_1.assert)(urlModified.startsWith('/'));
|
|
98
97
|
return { urlModified, origin };
|
|
99
98
|
}
|
|
100
99
|
function setUrlOrigin(url, origin) {
|
|
@@ -15,6 +15,7 @@ async function build(options = {}) {
|
|
|
15
15
|
if (viteConfigFromUserEnhanced)
|
|
16
16
|
viteConfigFromUserEnhanced._viteConfigFromUserEnhanced = viteConfigFromUserEnhanced;
|
|
17
17
|
if (vikeConfig.global.config.vite6BuilderApp) {
|
|
18
|
+
// This assertion isn't reliable: the user may still use a Vite version older than 6.0.0 — see https://github.com/vitejs/vite/pull/19355
|
|
18
19
|
assertVersion('Vite', version, '6.0.0');
|
|
19
20
|
const builder = await createBuilder(viteConfigFromUserEnhanced);
|
|
20
21
|
// See Vite plugin vike:build:pluginBuildApp
|
|
@@ -9,6 +9,8 @@ function onLoad() {
|
|
|
9
9
|
assertIsNotBrowser();
|
|
10
10
|
assertNodeVersion();
|
|
11
11
|
// package.json#peerDependencies isn't enough as users often ignore it
|
|
12
|
+
// This assertion isn't reliable: the user may still use a Vite version older than 5.1.0 — see https://github.com/vitejs/vite/pull/19355
|
|
13
|
+
// TO-DO/soon: let's also use this.meta.viteVersion https://github.com/vitejs/vite/pull/20088
|
|
12
14
|
assertVersion('Vite', version, '5.1.0');
|
|
13
15
|
// Ensure we don't bloat the server runtime with heavy dependencies such Vite and esbuild
|
|
14
16
|
assertIsNotProductionRuntime();
|
|
@@ -47,6 +47,7 @@ function pluginDistFileNames() {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
// Disable CSS bundling to workaround https://github.com/vikejs/vike/issues/1815
|
|
50
|
+
// TO-DO/eventually: let's bundle CSS again once Rolldown replaces Rollup
|
|
50
51
|
if (id.endsWith('.css')) {
|
|
51
52
|
const userRootDir = config.root;
|
|
52
53
|
if (id.startsWith(userRootDir)) {
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/assertExtensions.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { assertExtensionsConventions };
|
|
2
2
|
export { assertExtensionsRequire };
|
|
3
3
|
import type { PlusFile } from './getPlusFilesAll.js';
|
|
4
|
-
import { PageConfigBuildTime } from '../../../../../../shared/page-configs/PageConfig.js';
|
|
5
4
|
declare function assertExtensionsConventions(plusFile: PlusFile): void;
|
|
6
|
-
declare function assertExtensionsRequire(
|
|
5
|
+
declare function assertExtensionsRequire(plusFiles: PlusFile[]): void;
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/assertExtensions.js
CHANGED
|
@@ -28,8 +28,8 @@ function assertExtensionName(plusFile) {
|
|
|
28
28
|
const name = getNameValue(plusFile);
|
|
29
29
|
assertUsage(name, `Vike extension name missing: the config ${filePathToShowToUser} must define the setting ${pc.cyan('name')}`);
|
|
30
30
|
}
|
|
31
|
-
function assertExtensionsRequire(
|
|
32
|
-
const plusFilesRelevantList =
|
|
31
|
+
function assertExtensionsRequire(plusFiles) {
|
|
32
|
+
const plusFilesRelevantList = plusFiles;
|
|
33
33
|
// Collect extensions
|
|
34
34
|
const extensions = {};
|
|
35
35
|
plusFilesRelevantList.forEach((plusFile) => {
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/getPlusFilesAll.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getConfigFileExport } from './getConfigFileExport.js';
|
|
|
7
7
|
import { loadConfigFile, loadValueFile } from './loadFileAtConfigTime.js';
|
|
8
8
|
import { resolvePointerImport } from './resolvePointerImport.js';
|
|
9
9
|
import { getFilePathResolved } from '../../../../shared/getFilePath.js';
|
|
10
|
-
import { assertExtensionsConventions } from './assertExtensions.js';
|
|
10
|
+
import { assertExtensionsConventions, assertExtensionsRequire } from './assertExtensions.js';
|
|
11
11
|
async function getPlusFilesAll(userRootDir, esbuildCache) {
|
|
12
12
|
const plusFiles = await findPlusFiles(userRootDir);
|
|
13
13
|
const configFiles = [];
|
|
@@ -80,8 +80,13 @@ async function getPlusFilesAll(userRootDir, esbuildCache) {
|
|
|
80
80
|
Object.entries(plusFilesAll).forEach(([_locationId, plusFiles]) => {
|
|
81
81
|
plusFiles.sort(sortMakeDeterministic);
|
|
82
82
|
});
|
|
83
|
+
assertPlusFiles(plusFilesAll);
|
|
83
84
|
return plusFilesAll;
|
|
84
85
|
}
|
|
86
|
+
function assertPlusFiles(plusFilesAll) {
|
|
87
|
+
const plusFiles = Object.values(plusFilesAll).flat();
|
|
88
|
+
assertExtensionsRequire(plusFiles);
|
|
89
|
+
}
|
|
85
90
|
function getPlusFileFromConfigFile(configFile, isExtensionConfig, locationId, userRootDir) {
|
|
86
91
|
const { fileExports, filePath, extendsFilePaths } = configFile;
|
|
87
92
|
const fileExportsByConfigName = {};
|
|
@@ -20,7 +20,6 @@ import { loadPointerImport, loadValueFile } from './getVikeConfig/loadFileAtConf
|
|
|
20
20
|
import { resolvePointerImport } from './getVikeConfig/resolvePointerImport.js';
|
|
21
21
|
import { getFilePathResolved } from '../../../shared/getFilePath.js';
|
|
22
22
|
import { getConfigValueBuildTime } from '../../../../../shared/page-configs/getConfigValueBuildTime.js';
|
|
23
|
-
import { assertExtensionsRequire } from './getVikeConfig/assertExtensions.js';
|
|
24
23
|
import { getUserFriendlyConfigsGlobal, getUserFriendlyConfigsPageEager } from '../../../../../shared/page-configs/getUserFriendlyConfigs.js';
|
|
25
24
|
import { getConfigValuesBase, isJsonValue } from '../../../../../shared/page-configs/serialize/serializeConfigValues.js';
|
|
26
25
|
import { getPlusFilesAll } from './getVikeConfig/getPlusFilesAll.js';
|
|
@@ -322,7 +321,6 @@ function assertGlobalConfigLocation(configName, sources, plusFilesAll, configDef
|
|
|
322
321
|
}
|
|
323
322
|
function assertPageConfigs(pageConfigs) {
|
|
324
323
|
pageConfigs.forEach((pageConfig) => {
|
|
325
|
-
assertExtensionsRequire(pageConfig);
|
|
326
324
|
assertOnBeforeRenderEnv(pageConfig);
|
|
327
325
|
});
|
|
328
326
|
}
|
|
@@ -66,7 +66,9 @@ function serializeObject(obj, objName, passToClient) {
|
|
|
66
66
|
if (isJsonSerializerError(err)) {
|
|
67
67
|
pathString = err.pathString;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
// There used to be a `## Serialization Error` section in the docs but we removed it at:
|
|
70
|
+
// https://github.com/vikejs/vike/commit/c9da2f577db01bd1c8f72265ff83e78484ddc2c0
|
|
71
|
+
assertUsage(false, `Cannot serialize config value ${h(pathString)} set by useConfig()`);
|
|
70
72
|
}
|
|
71
73
|
// Non-serializable property set by the user
|
|
72
74
|
let msg = [
|
|
@@ -100,7 +100,7 @@ function getHttpResponseBodyStreamHandlers(htmlRender, renderHook) {
|
|
|
100
100
|
assert(['a ', 'an ', 'the '].some((s) => streamName.startsWith(s)));
|
|
101
101
|
assert(renderHook);
|
|
102
102
|
const { hookFilePath, hookName } = renderHook;
|
|
103
|
-
return `Make sure the ${hookName}() defined by ${hookFilePath}
|
|
103
|
+
return `Make sure the ${hookName}() hook defined by ${hookFilePath} provides ${streamName} instead`;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
function getErrMsg(htmlRender, renderHook, method, msgAddendum) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { resolveRedirects };
|
|
2
2
|
export { resolveRouteStringRedirect };
|
|
3
|
-
export { redirectsErrPrefix };
|
|
4
|
-
declare const redirectsErrPrefix = "[+redirects]";
|
|
5
3
|
declare function resolveRedirects(redirectsAll: Record<string, string>[], urlPathname: string): null | string;
|
|
6
4
|
declare function resolveRouteStringRedirect(urlSource: string, urlTarget: string, urlPathname: string): null | string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { resolveRedirects };
|
|
2
2
|
// For ./resolveRedirects.spec.ts
|
|
3
3
|
export { resolveRouteStringRedirect };
|
|
4
|
-
export { redirectsErrPrefix };
|
|
5
4
|
import { assertIsNotBrowser } from '../../../utils/assertIsNotBrowser.js';
|
|
6
5
|
import { assert, assertUsage, assertUsageUrlRedirectTarget, isUrlRedirectTarget } from '../../../shared/utils.js';
|
|
7
6
|
import { resolveUrlPathname } from '../../../shared/route/resolveUrlPathname.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.230-commit-8b60b8c";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.
|
|
2
|
+
export const PROJECT_VERSION = '0.4.230-commit-8b60b8c';
|
package/dist/esm/utils/isDev.js
CHANGED
|
@@ -4,7 +4,9 @@ export { applyPreview };
|
|
|
4
4
|
import { assertUsage } from './assert.js';
|
|
5
5
|
function isDevCheck(configEnv) {
|
|
6
6
|
const { isPreview, command } = configEnv;
|
|
7
|
-
//
|
|
7
|
+
// Note that:
|
|
8
|
+
// - `assertVersion('Vite', version, '5.1.0')` at node/plugin/onLoad.ts isn't enough: https://github.com/vitejs/vite/pull/19355
|
|
9
|
+
// - We'll eventually be able to make this an assert() instead of assertUsage() once Vike requires a Vite version that supports this.meta.viteVersion
|
|
8
10
|
assertUsage(typeof isPreview === 'boolean', 'You are using an old Vite version; make sure to use Vite 5.1.0 or above.');
|
|
9
11
|
return command === 'serve' && !isPreview;
|
|
10
12
|
}
|
|
@@ -92,7 +92,6 @@ function modifyUrlPathname(url, modifier) {
|
|
|
92
92
|
function removeUrlOrigin(url) {
|
|
93
93
|
const { origin, pathnameOriginal, searchOriginal, hashOriginal } = parseUrl(url, '/');
|
|
94
94
|
const urlModified = createUrlFromComponents(null, pathnameOriginal, searchOriginal, hashOriginal);
|
|
95
|
-
assert(urlModified.startsWith('/'));
|
|
96
95
|
return { urlModified, origin };
|
|
97
96
|
}
|
|
98
97
|
function setUrlOrigin(url, origin) {
|