Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var expectedKeys = ['rho', 'u', 'v', 'w', 'p'];
expectedKeys.forEach(function(el) {
soln['ics.' + el] = {
id: 'ics.ics.' + el,
value: source[el] !== undefined ? [ source[el].trim() ] : []
};
});
var customIcs = { id: 'ics.ics.custom', value: [] };
Object.keys(source).forEach(function(el) {
if (expectedKeys.indexOf(el) !== -1) {
return;
}
customIcs.value.push({ name: el, value: [source[el].trim()] });
});
soln['ics.custom'] = customIcs;
}
defaults[solnKey] = soln;
return defaults;
}