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

Function parseLinker

extensions/amp-analytics/0.1/linker.js:46–57  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

44 * @return {?{[key: string]: string}}
45 */
46export function parseLinker(value) {
47 const linkerObj = parseLinkerParamValue(value);
48 if (!linkerObj) {
49 return null;
50 }
51 const {checksum, serializedIds} = linkerObj;
52 if (!isCheckSumValid(serializedIds, checksum)) {
53 user().error(TAG, 'LINKER_PARAM value checksum not valid');
54 return null;
55 }
56 return deserialize(serializedIds);
57}
58
59/**
60 * Parse the linker param value to version checksum and serializedParams

Callers 2

test-linker.jsFile · 0.90

Calls 5

userFunction · 0.90
parseLinkerParamValueFunction · 0.70
isCheckSumValidFunction · 0.70
deserializeFunction · 0.70
errorMethod · 0.45

Tested by

no test coverage detected