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

Function encodeQueryValue

ads/vendors/adgeneration.js:37–46  ·  view source on GitHub ↗

* URL encoding of query string * @param {string} str * @return {string}

(str)

Source from the content-addressed store, hash-verified

35 * @return {string}
36 */
37function encodeQueryValue(str) {
38 return str
39 .split('&')
40 .map((v) => {
41 const key = v.split('=')[0],
42 val = v.split('=')[1];
43 return encodeURIComponent(key) + '=' + encodeURIComponent(val);
44 })
45 .join('&');
46}
47/**
48 * If adtype is "RECTANGLE", replace it with "RECT"
49 * @param {string} str

Callers 1

adgenerationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected