Skip to content
Snippets Groups Projects
Unverified Commit 3a19a2f4 authored by chris48s's avatar chris48s Committed by GitHub
Browse files

fix badge CLI debug script (#4865)

parent 00be3666
Branches
Tags
No related merge requests found
...@@ -10,7 +10,10 @@ const trace = require('../core/base-service/trace') ...@@ -10,7 +10,10 @@ const trace = require('../core/base-service/trace')
function normalizeBadgeUrl(url) { function normalizeBadgeUrl(url) {
// Provide a base URL in order to accept fragments. // Provide a base URL in order to accept fragments.
const { pathname, searchParams } = new URL(url, 'http://example.com') const { pathname, searchParams } = new URL(url, 'http://example.com')
const newPath = pathname.replace('.svg', '.json') let newPath = pathname.replace('.svg', '')
if (!newPath.endsWith('.json')) {
newPath = `${newPath}.json`
}
return `${newPath}?${searchParams.toString()}` return `${newPath}?${searchParams.toString()}`
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment