@docusaurus/utils-common
Advanced tools
Comparing version 2.0.0-beta.41eaa690e to 2.0.0-beta.462b1cf2b
@@ -21,2 +21,5 @@ "use strict"; | ||
} | ||
function handleTrailingSlash(str, trailing) { | ||
return trailing ? addTrailingSlash(str) : removeTrailingSlash(str); | ||
} | ||
// undefined = legacy retrocompatible behavior | ||
@@ -29,9 +32,5 @@ if (typeof trailingSlash === 'undefined') { | ||
// Never transform '/' to '' | ||
const newPathname = pathname === '/' | ||
? '/' | ||
: trailingSlash | ||
? addTrailingSlash(pathname) | ||
: removeTrailingSlash(pathname); | ||
const newPathname = pathname === '/' ? '/' : handleTrailingSlash(pathname, trailingSlash); | ||
return path.replace(pathname, newPathname); | ||
} | ||
exports.default = applyTrailingSlash; |
{ | ||
"name": "@docusaurus/utils-common", | ||
"version": "2.0.0-beta.41eaa690e", | ||
"version": "2.0.0-beta.462b1cf2b", | ||
"description": "Common (Node/Browser) utility functions for Docusaurus packages.", | ||
@@ -21,3 +21,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@docusaurus/types": "2.0.0-beta.41eaa690e", | ||
"@docusaurus/types": "2.0.0-beta.462b1cf2b", | ||
"tslib": "^2.2.0" | ||
@@ -28,3 +28,3 @@ }, | ||
}, | ||
"gitHead": "2c55b3a650d826c87c1d4a6c52dcca9309ccdcb6" | ||
"gitHead": "170c20d175e390bcfc788b8802eb7cdebecf2852" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
61618
290
+ Added@docusaurus/types@2.0.0-beta.462b1cf2b(transitive)
- Removed@docusaurus/types@2.0.0-beta.41eaa690e(transitive)