gatsby-plugin-client-side-redirect
Advanced tools
Comparing version 0.0.2 to 1.0.0
@@ -7,9 +7,15 @@ module.exports = function getMetaRedirect(toPath) { | ||
const hasLeadingSlash = url.startsWith('/'); | ||
const hasTrailingSlash = url.endsWith('/'); | ||
if (!hasLeadingSlash) { | ||
url = `/${url}`; | ||
} | ||
if(hasTrailingSlash) { | ||
url = url.slice(0, -1); | ||
} | ||
const resemblesFile = url.includes('.'); | ||
if (!resemblesFile) { | ||
url = `${url}/`.replace(/\/\/+/g, '/'); | ||
url = `${url}`.replace(/\/\/+/g, '/'); | ||
} | ||
@@ -16,0 +22,0 @@ } |
{ | ||
"name": "gatsby-plugin-client-side-redirect", | ||
"version": "0.0.2", | ||
"version": "1.0.0", | ||
"repository": "git@github.com:dhakerShiv/gatsby-plugin-client-side-redirect.git", | ||
@@ -5,0 +5,0 @@ "author": "Shivnarayan Dhaker <shivnarayandhakar@gmail.com>", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5271
53
1