@docusaurus/utils-common
Advanced tools
Comparing version 2.0.0-beta.364051f23 to 2.0.0-beta.41b78466d
@@ -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.364051f23", | ||
"version": "2.0.0-beta.41b78466d", | ||
"description": "Common (Node/Browser) utility functions for Docusaurus packages.", | ||
@@ -21,3 +21,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@docusaurus/types": "2.0.0-beta.364051f23", | ||
"@docusaurus/types": "2.0.0-beta.41b78466d", | ||
"tslib": "^2.2.0" | ||
@@ -28,3 +28,3 @@ }, | ||
}, | ||
"gitHead": "30173993e0ae3bf3e6b4402ebd8e7c7c9979814b" | ||
"gitHead": "7ee53c8fcf0bd3bfb809e440ab9883a7c0debebc" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
61618
290
+ Added@docusaurus/types@2.0.0-beta.41b78466d(transitive)
- Removed@docusaurus/types@2.0.0-beta.364051f23(transitive)