UNPKG

dfp-lib

Version:

This project hosts the Node.JS client library for the SOAP-based DFP API at Google.

27 lines (26 loc) 860 B
"use strict"; const stringValueMapEntry_1 = require("../../dfp/soap/stringValueMapEntry"); var MapUtils; (function (MapUtils) { function getMap(mapEntries) { const result = {}; for (let i = 0, n = mapEntries.length; i < n; ++i) { result[mapEntries[i].key] = mapEntries[i].value; } return result; } MapUtils.getMap = getMap; function getMapEntries(map) { const result = []; for (let key in map) { if (map.hasOwnProperty(key)) { const entry = new stringValueMapEntry_1.StringValueMapEntry(); entry.key = key; entry.value = map[key]; result.push(entry); } } return result; } MapUtils.getMapEntries = getMapEntries; })(MapUtils = exports.MapUtils || (exports.MapUtils = {}));