23 lines
549 B
JavaScript
23 lines
549 B
JavaScript
/**
|
|
* Pick parameters which are significant for including into license file
|
|
*/
|
|
exports.pickParams = function (appId, systemParams) {
|
|
// if (appId === 'coc') {
|
|
const appParams = ['biosSerialNum', 'osId', 'diskSerialNum', 'nicMac'];
|
|
const requiredParams = 2;
|
|
// }
|
|
|
|
let resParams = {};
|
|
console.log(systemParams)
|
|
for (paramId of appParams) {
|
|
if (systemParams.hasOwnProperty(paramId)) {
|
|
resParams[paramId] = systemParams[paramId];
|
|
}
|
|
|
|
if (Object.keys(resParams).length === requiredParams) {
|
|
return resParams;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}; |