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

Method get

extensions/amp-analytics/0.1/linker-reader.js:31–46  ·  view source on GitHub ↗

* Get the LINKER_PARAM(name, id) value from url and clean the value * @param {string} name * @param {string} id * @return {?string}

(name, id)

Source from the content-addressed store, hash-verified

29 * @return {?string}
30 */
31 get(name, id) {
32 if (!name || !id) {
33 user().error(TAG, 'LINKER_PARAM requires two params, name and id');
34 return null;
35 }
36
37 if (!hasOwn(this.linkerParams_, name)) {
38 this.linkerParams_[name] = this.parseAndCleanQueryString_(name);
39 }
40
41 if (this.linkerParams_[name] && this.linkerParams_[name][id]) {
42 return this.linkerParams_[name][id];
43 }
44
45 return null;
46 }
47
48 /**
49 * Parse the url get the key value pair for the linker name

Callers 15

upgradeCallbackMethod · 0.45
getSingleLineEmbed_Method · 0.45
invokeValidator_Method · 0.45
validateMethod · 0.45
fetchMethod · 0.45
initializeMethod · 0.45
initiateAdRequestMethod · 0.45
extractSizeMethod · 0.45
whenWithinViewportFunction · 0.45
callbackFunction · 0.45
createObserverFunction · 0.45

Calls 4

userFunction · 0.90
hasOwnFunction · 0.90
errorMethod · 0.45

Tested by

no test coverage detected