t-configurator
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -20,2 +20,8 @@ var ConfiguratorUtils_1 = require("./ConfiguratorUtils"); | ||
}; | ||
/** | ||
* Returns a copy of the configuration. | ||
*/ | ||
Configurator.prototype.getAll = function () { | ||
return ConfiguratorUtils_1.ConfiguratorUtils.deepClone(this.configuration); | ||
}; | ||
Configurator.prototype.replaceWithParameters = function (parameters) { | ||
@@ -22,0 +28,0 @@ var _this = this; |
@@ -43,4 +43,16 @@ var ConfiguratorUtils = (function () { | ||
}; | ||
ConfiguratorUtils.deepClone = function (obj) { | ||
var newObj = (obj instanceof Array) ? [] : {}; | ||
for (var i in obj) { | ||
if (obj[i] && typeof obj[i] == "object") { | ||
newObj[i] = this.deepClone(obj[i]); | ||
} | ||
else { | ||
newObj[i] = obj[i]; | ||
} | ||
} | ||
return newObj; | ||
}; | ||
return ConfiguratorUtils; | ||
})(); | ||
exports.ConfiguratorUtils = ConfiguratorUtils; |
{ | ||
"name": "t-configurator", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Allows to manage configuration files in your project", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -5,2 +5,3 @@ declare module 't-configurator/ConfiguratorUtils' { | ||
static flatten(data: any): any; | ||
static deepClone(obj: any): any; | ||
} | ||
@@ -14,2 +15,6 @@ | ||
get(key: string, searchFlattened?: boolean): any; | ||
/** | ||
* Returns a copy of the configuration. | ||
*/ | ||
getAll(): any; | ||
replaceWithParameters(parameters: any): any; | ||
@@ -16,0 +21,0 @@ private normalizeType(value, originalValue); |
11243
164