mirror of
https://github.com/danbulant/discord.js
synced 2026-06-21 07:42:36 +00:00
Webpack build for branch custom-structures: f004e6ccca
This commit is contained in:
parent
e855a4b0e4
commit
b231d6e992
2 changed files with 13 additions and 2 deletions
|
|
@ -1664,7 +1664,7 @@ class DataStore extends Collection {
|
|||
constructor(client, iterable, holds) {
|
||||
super();
|
||||
Object.defineProperty(this, 'client', { value: client });
|
||||
Object.defineProperty(this, 'holds', { value: Structures.get(holds.name) });
|
||||
Object.defineProperty(this, 'holds', { value: Structures.get(holds) });
|
||||
if (iterable) for (const item of iterable) this.create(item);
|
||||
}
|
||||
|
||||
|
|
@ -9608,6 +9608,17 @@ class Structures {
|
|||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a structure class.
|
||||
* @param {string|Function} structure Name of the structure or a class/prototype function to use the name of
|
||||
* @returns {Function}
|
||||
*/
|
||||
static get(structure) {
|
||||
if (typeof structure === 'string') return structures[structure];
|
||||
if (typeof structure === 'function') return structures[structure.name];
|
||||
throw new TypeError(`Structure to retrieve must be a string or class/prototype function, not ${typeof structure}.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends a structure.
|
||||
* @param {string} name Name of the structure class to extend
|
||||
|
|
|
|||
2
discord.custom-structures.min.js
vendored
2
discord.custom-structures.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue