19 lines
1.9 KiB
JavaScript
19 lines
1.9 KiB
JavaScript
"use strict";
|
|
/**
|
|
* converts an erray of env strings from docker remote api to an usable object.
|
|
* @param envArrayArg
|
|
* @returns {}
|
|
*/
|
|
exports.makeEnvObject = function (envArrayArg) {
|
|
var returnObject = {};
|
|
var regexString = /(.*)=(.*)/;
|
|
for (var envKey in envArrayArg) {
|
|
var regexMatches = regexString.exec(envArrayArg[envKey]);
|
|
returnObject[regexMatches[1]] = regexMatches[2];
|
|
}
|
|
;
|
|
return returnObject;
|
|
};
|
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLmRvY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBR0E7Ozs7R0FJRztBQUNRLHFCQUFhLEdBQUcsVUFBUyxXQUFvQjtJQUNwRCxJQUFJLFlBQVksR0FBRyxFQUFFLENBQUM7SUFDdEIsSUFBSSxXQUFXLEdBQUcsV0FBVyxDQUFDO0lBQzlCLEdBQUcsQ0FBQSxDQUFDLElBQUksTUFBTSxJQUFJLFdBQVcsQ0FBQyxDQUFBLENBQUM7UUFDM0IsSUFBSSxZQUFZLEdBQUcsV0FBVyxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQztRQUN6RCxZQUFZLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ3BELENBQUM7SUFBQSxDQUFDO0lBQ0YsTUFBTSxDQUFDLFlBQVksQ0FBQztBQUN4QixDQUFDLENBQUMiLCJmaWxlIjoic21hcnRzdHJpbmcuZG9ja2VyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IHBsdWdpbnMgPSByZ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