Skip to content

Commit

Permalink
fix: replace regex
Browse files Browse the repository at this point in the history
  • Loading branch information
filipemarins committed Nov 18, 2022
1 parent 5c4c331 commit 44cf352
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const buildImageURL = (url: string, imageUrl: string): string => {

const { origin } = new URL(url);
const imgURL = `${origin}/${imageUrl}`;
const normalizedUrl = imgURL.replace(/(?<!:)\/+/gm, '/');
const normalizedUrl = imgURL.replace(/([^:]\/)\/+/g, '$1');

return JSON.stringify(normalizedUrl);
};
Expand Down

0 comments on commit 44cf352

Please sign in to comment.