* @param {!Object} data * @return {JsonObject}
(data)
| 43 | * @return {JsonObject} |
| 44 | */ |
| 45 | function 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 |
no test coverage detected