MCPcopy Create free account
hub / github.com/ampproject/amphtml / appendQueryParamsToUrl

Function appendQueryParamsToUrl

build-system/server/app-index/url.js:1–6  ·  view source on GitHub ↗
(url, params)

Source from the content-addressed store, hash-verified

1const appendQueryParamsToUrl = (url, params) =>
2 url +
3 '?' +
4 Object.keys(params)
5 .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`)
6 .join('&');
7
8const leadingSlashRegex = /^\//;
9const replaceLeadingSlash = (subject, replacement) =>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected