deep-kernel
Advanced tools
Comparing version 1.12.1 to 1.12.2
@@ -345,2 +345,67 @@ /** | ||
}, { | ||
key: 'getMsParam', | ||
/** | ||
* @param {String} msIdentifier | ||
* @param {String} paramPath | ||
* @param {*} defaultValue | ||
* | ||
* @returns {*} | ||
*/ | ||
value: function getMsParam(msIdentifier, paramPath) { | ||
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
return this._findParam(this._config[msIdentifier].parameters, paramPath, defaultValue); | ||
} | ||
/** | ||
* @param {String} paramPath | ||
* @param {*} defaultValue | ||
* | ||
* @returns {*} | ||
*/ | ||
}, { | ||
key: 'getParam', | ||
value: function getParam(paramPath) { | ||
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
return this._findParam(this._config.globals, paramPath, defaultValue); | ||
} | ||
/** | ||
* @param {*} params | ||
* @param {String} paramPath | ||
* @param {*} defaultValue | ||
* | ||
* @returns {*} | ||
* | ||
* @private | ||
*/ | ||
}, { | ||
key: '_findParam', | ||
value: function _findParam(params, paramPath, defaultValue) { | ||
let paramParts = paramPath.split('|').map(x => x.trim()); | ||
let result = params; | ||
for (let i = 0; i < paramParts.length; i++) { | ||
let param = paramParts[i]; | ||
if (!result || typeof result !== 'object' && !result.hasOwnProperty(param)) { | ||
return defaultValue; | ||
} | ||
result = result[param]; | ||
} | ||
return result; | ||
} | ||
/** | ||
* @returns {Microservice[]} | ||
*/ | ||
}, { | ||
key: '_buildContainer', | ||
@@ -591,7 +656,2 @@ | ||
} | ||
/** | ||
* @returns {Microservice[]} | ||
*/ | ||
}, { | ||
@@ -598,0 +658,0 @@ key: 'microservices', |
{ | ||
"name": "deep-kernel", | ||
"version": "1.12.1", | ||
"version": "1.12.2", | ||
"description": "DEEP Kernel Library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74591
1801