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

Function getInitData

ads/vendors/runative.js:45–60  ·  view source on GitHub ↗

* @param {!Object} data * @return {JsonObject}

(data)

Source from the content-addressed store, hash-verified

43 * @return {JsonObject}
44 */
45function getInitData(data) {
46 const initKeys = requiredParams.concat(optionsParams);
47 const initParams = {};
48
49 initKeys.forEach((key) => {
50 if (key in data) {
51 const initKey = key === 'adType' ? 'type' : key;
52
53 initParams[initKey] = data[key];
54 }
55 });
56
57 initParams['element_id'] = adContainerId;
58
59 return parseJson(initParams);
60}
61
62/**
63 * @param {!Window} global

Callers 1

getInitAdScriptFunction · 0.70

Calls 3

parseJsonFunction · 0.90
concatMethod · 0.80
forEachMethod · 0.45

Tested by

no test coverage detected