@embroider/shared-internals
Advanced tools
Comparing version 2.6.3-unstable.5063729 to 2.6.3-unstable.9372659
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.6.3-unstable.5063729", | ||
"version": "2.6.3-unstable.9372659", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Utilities shared among the other embroider packages", |
@@ -18,1 +18,2 @@ export { AppMeta, AddonMeta, PackageInfo } from './metadata'; | ||
export * from './dep-validation'; | ||
export * from './colocation'; |
@@ -56,2 +56,3 @@ "use strict"; | ||
__exportStar(require("./dep-validation"), exports); | ||
__exportStar(require("./colocation"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -5,4 +5,4 @@ import type Package from './package'; | ||
export declare function unrelativize(pkg: Package, specifier: string, fromFile: string): string; | ||
export declare function cleanUrl(url: string, includeHashSign?: boolean): string; | ||
export declare function getUrlQueryParams(url: string, includeHashSign?: boolean): string; | ||
export declare function cleanUrl(url: string): string; | ||
export declare function getUrlQueryParams(url: string): string; | ||
export declare function correspondingTemplate(filename: string): string; |
@@ -21,3 +21,3 @@ "use strict"; | ||
} | ||
if ((0, path_1.isAbsolute)(toFile) && result.endsWith(toFile)) { | ||
if ((0, path_1.isAbsolute)(toFile) && result.split(path_1.sep).join('/').endsWith(toFile)) { | ||
// this prevents silly "relative" paths like | ||
@@ -49,18 +49,13 @@ // "../../../../../Users/you/projects/your/stuff" when we could have just | ||
const postfixRE = /[?#].*$/s; | ||
// this pattern includes URL query params (ex: ?direct) | ||
// but excludes specifiers starting with # (ex: #embroider_compats/components/fancy) | ||
// so when using this pattern, #embroider_compat/fancy would be consider a pathname | ||
// without any params. | ||
const postfixREQueryParams = /[?].*$/s; | ||
// this is the same implementation Vite uses internally to keep its | ||
// cache-busting query params from leaking where they shouldn't. | ||
// includeHashSign true means #my-specifier is considered part of the pathname | ||
function cleanUrl(url, includeHashSign = false) { | ||
const regexp = includeHashSign ? postfixREQueryParams : postfixRE; | ||
function cleanUrl(url) { | ||
const regexp = postfixRE; | ||
return url.replace(regexp, ''); | ||
} | ||
// includeHashSign true means #my-specifier is considered part of the pathname | ||
function getUrlQueryParams(url, includeHashSign = false) { | ||
function getUrlQueryParams(url) { | ||
var _a, _b; | ||
const regexp = includeHashSign ? postfixREQueryParams : postfixRE; | ||
const regexp = postfixRE; | ||
return (_b = (_a = url.match(regexp)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ''; | ||
@@ -67,0 +62,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
163594
62
1619
12