@vuepress/shared
Advanced tools
Comparing version 2.0.0-beta.61 to 2.0.0-beta.62
@@ -37,6 +37,6 @@ // src/utils/index.ts | ||
// src/utils/ensureLeadingSlash.ts | ||
var ensureLeadingSlash = (str) => str.replace(/^\/?/, "/"); | ||
var ensureLeadingSlash = (str) => str[0] === "/" ? str : `/${str}`; | ||
// src/utils/ensureEndingSlash.ts | ||
var ensureEndingSlash = (str) => /(\.html|\/)$/.test(str) ? str : str + "/"; | ||
var ensureEndingSlash = (str) => str[str.length - 1] === "/" || str.endsWith(".html") ? str : `${str}/`; | ||
@@ -90,6 +90,6 @@ // src/utils/formatDateString.ts | ||
// src/utils/removeEndingSlash.ts | ||
var removeEndingSlash = (str) => str.replace(/\/$/, ""); | ||
var removeEndingSlash = (str) => str[str.length - 1] === "/" ? str.slice(0, -1) : str; | ||
// src/utils/removeLeadingSlash.ts | ||
var removeLeadingSlash = (str) => str.replace(/^\//, ""); | ||
var removeLeadingSlash = (str) => str[0] === "/" ? str.slice(1) : str; | ||
@@ -114,3 +114,6 @@ // src/utils/resolveLocalePath.ts | ||
// src/utils/resolveRoutePathFromUrl.ts | ||
var resolveRoutePathFromUrl = (url, base = "/") => url.replace(/^(https?:)?\/\/[^/]*/, "").replace(new RegExp(`^${base}`), "/"); | ||
var resolveRoutePathFromUrl = (url, base = "/") => { | ||
const pathname = url.replace(/^(https?:)?\/\/[^/]*/, ""); | ||
return pathname.startsWith(base) ? `/${pathname.slice(base.length)}` : pathname; | ||
}; | ||
export { | ||
@@ -117,0 +120,0 @@ dedupeHead, |
@@ -37,6 +37,6 @@ // src/utils/index.ts | ||
// src/utils/ensureLeadingSlash.ts | ||
var ensureLeadingSlash = (str) => str.replace(/^\/?/, "/"); | ||
var ensureLeadingSlash = (str) => str[0] === "/" ? str : `/${str}`; | ||
// src/utils/ensureEndingSlash.ts | ||
var ensureEndingSlash = (str) => /(\.html|\/)$/.test(str) ? str : str + "/"; | ||
var ensureEndingSlash = (str) => str[str.length - 1] === "/" || str.endsWith(".html") ? str : `${str}/`; | ||
@@ -90,6 +90,6 @@ // src/utils/formatDateString.ts | ||
// src/utils/removeEndingSlash.ts | ||
var removeEndingSlash = (str) => str.replace(/\/$/, ""); | ||
var removeEndingSlash = (str) => str[str.length - 1] === "/" ? str.slice(0, -1) : str; | ||
// src/utils/removeLeadingSlash.ts | ||
var removeLeadingSlash = (str) => str.replace(/^\//, ""); | ||
var removeLeadingSlash = (str) => str[0] === "/" ? str.slice(1) : str; | ||
@@ -114,3 +114,6 @@ // src/utils/resolveLocalePath.ts | ||
// src/utils/resolveRoutePathFromUrl.ts | ||
var resolveRoutePathFromUrl = (url, base = "/") => url.replace(/^(https?:)?\/\/[^/]*/, "").replace(new RegExp(`^${base}`), "/"); | ||
var resolveRoutePathFromUrl = (url, base = "/") => { | ||
const pathname = url.replace(/^(https?:)?\/\/[^/]*/, ""); | ||
return pathname.startsWith(base) ? `/${pathname.slice(base.length)}` : pathname; | ||
}; | ||
export { | ||
@@ -117,0 +120,0 @@ dedupeHead, |
{ | ||
"name": "@vuepress/shared", | ||
"version": "2.0.0-beta.61", | ||
"version": "2.0.0-beta.62", | ||
"description": "Utils that shared between VuePress node and client", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"@mdit-vue/types": "^0.12.0", | ||
"@vue/shared": "^3.2.47" | ||
"@vue/shared": "^3.3.1" | ||
}, | ||
@@ -36,0 +36,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16368
495
Updated@vue/shared@^3.3.1