spessasynth_lib
Version:
MIDI and SoundFont2/DLS library for the browsers with no compromises
21 lines • 395 B
JavaScript
/**
* Fills the object with default values
* @param obj {Object}
* @param defObj {Object}
* @returns {Object}
*/
export function fillWithDefaults(obj, defObj)
{
if (obj === undefined)
{
obj = {};
}
for (const key in defObj)
{
if (defObj.hasOwnProperty(key) && !(key in obj))
{
obj[key] = defObj[key];
}
}
return obj;
}