MCPcopy Create free account
hub / github.com/Swizec/article-threader / getCleanUrl

Function getCleanUrl

pages/api/findKeyInsight.ts:20–30  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

18
19// remove utm params, the most likely for us to be useless
20function getCleanUrl(url: string): string {
21 const parsed = new URL(url);
22
23 for (const param of Array.from(parsed.searchParams.keys())) {
24 if (param.startsWith("utm_")) {
25 parsed.searchParams.delete(param);
26 }
27 }
28
29 return parsed.toString();
30}
31
32const findKeyInsight: NextApiHandler = async (req, res) => {
33 const { url } = req.body;

Callers 1

findKeyInsightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected