2016-05-25 03:06:19 +00:00
|
|
|
import "typings-global"
|
2016-04-15 22:58:44 +00:00
|
|
|
import plugins = require("./smartstring.plugins");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* converts an erray of env strings from docker remote api to an usable object.
|
|
|
|
* @param envArrayArg
|
|
|
|
* @returns {}
|
|
|
|
*/
|
|
|
|
export let makeEnvObject = function(envArrayArg:string[]){
|
|
|
|
let returnObject = {};
|
|
|
|
let regexString = /(.*)=(.*)/;
|
|
|
|
for(let envKey in envArrayArg){
|
|
|
|
let regexMatches = regexString.exec(envArrayArg[envKey]);
|
|
|
|
returnObject[regexMatches[1]] = regexMatches[2];
|
|
|
|
};
|
|
|
|
return returnObject;
|
|
|
|
};
|