Skip to content

Commit

Permalink
chore: lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
moonmeister committed Dec 25, 2023
1 parent adb0f2f commit 329eafa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-fastify/src/utils/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function removeQueryParmsFromUrl(url: string) {
}

export function buildRedirectUrlFromParameters(path: string, data: { [s: string]: string } = {}) {
return path.replace(/:(\w+)|(\*)/gi, function (match, p1, p2) {
return path.replaceAll(/:(\w+)|(\*)/gi, function (match, p1, p2) {
if (p1 && !data[p1]) return match; // :Something in toPath does not have a splat in fromPath pass it through colon intact
let lookupString = p1 ?? p2;
let replacement = data[lookupString];
Expand Down

0 comments on commit 329eafa

Please sign in to comment.