mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
* Cleanup Part 2: Electric Boogaloo (Reloaded) * Moar cleanup * Tweak NOT_A_PERMISSION error
13 lines
305 B
JavaScript
13 lines
305 B
JavaScript
module.exports = function merge(def, given) {
|
|
if (!given) return def;
|
|
for (const key in def) {
|
|
if (!{}.hasOwnProperty.call(given, key)) {
|
|
given[key] = def[key];
|
|
} else if (given[key] === Object(given[key])) {
|
|
given[key] = merge(def[key], given[key]);
|
|
}
|
|
}
|
|
|
|
return given;
|
|
};
|