VulpesOS/gaia/apps/email/js/mix.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

20 lines
656 B
JavaScript
Executable file

'use strict';
define(function() {
/**
* Mixes properties from source into target.
* @param {Object} target target of the mix.
* @param {Object} source source object providing properties to mix in.
* @param {Boolean} override if target already has a the property,
* override it with the one from source.
* @return {Object} the target object, now with the new properties
* mixed in.
*/
return function mix(target, source, override) {
Object.keys(source).forEach(function(key) {
if (!target.hasOwnProperty(key) || override) {
target[key] = source[key];
}
});
return target;
};
});