mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
fix this again (#1655)
This commit is contained in:
@@ -2,6 +2,7 @@ const snekfetch = require('snekfetch');
|
|||||||
const Constants = require('./Constants');
|
const Constants = require('./Constants');
|
||||||
const ConstantsHttp = Constants.DefaultOptions.http;
|
const ConstantsHttp = Constants.DefaultOptions.http;
|
||||||
const { RangeError, TypeError } = require('../errors');
|
const { RangeError, TypeError } = require('../errors');
|
||||||
|
const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains various general-purpose utility methods. These functions are also available on the base `Discord` object.
|
* Contains various general-purpose utility methods. These functions are also available on the base `Discord` object.
|
||||||
@@ -128,7 +129,7 @@ class Util {
|
|||||||
static mergeDefault(def, given) {
|
static mergeDefault(def, given) {
|
||||||
if (!given) return def;
|
if (!given) return def;
|
||||||
for (const key in def) {
|
for (const key in def) {
|
||||||
if (!{}.hasOwnProperty.call(given, key) && def[key] !== undefined) {
|
if (!has(given, key) || given[key] === undefined) {
|
||||||
given[key] = def[key];
|
given[key] = def[key];
|
||||||
} else if (given[key] === Object(given[key])) {
|
} else if (given[key] === Object(given[key])) {
|
||||||
given[key] = this.mergeDefault(def[key], given[key]);
|
given[key] = this.mergeDefault(def[key], given[key]);
|
||||||
|
|||||||
Reference in New Issue
Block a user