smartstring/dist/smartstring.docker.js
2016-06-05 09:31:10 +02:00

20 lines
1.9 KiB
JavaScript

"use strict";
require("typings-global");
/**
* 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;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLmRvY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBR3ZCOzs7O0dBSUc7QUFDUSxxQkFBYSxHQUFHLFVBQVMsV0FBb0I7SUFDcEQsSUFBSSxZQUFZLEdBQUcsRUFBRSxDQUFDO0lBQ3RCLElBQUksV0FBVyxHQUFHLFdBQVcsQ0FBQztJQUM5QixHQUFHLENBQUEsQ0FBQyxJQUFJLE1BQU0sSUFBSSxXQUFXLENBQUMsQ0FBQSxDQUFDO1FBQzNCLElBQUksWUFBWSxHQUFHLFdBQVcsQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7UUFDekQsWUFBWSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUNwRCxDQUFDO0lBQUEsQ0FBQztJQUNGLE1BQU0sQ0FBQyxZQUFZLENBQUM7QUFDeEIsQ0FBQyxDQUFDIiwiZmlsZSI6InNtYXJ0c3RyaW5nLmRvY2tlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCJcbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vc21hcnRzdH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