mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
refactor(Util): make class extend null (#6000)
This commit is contained in:
@@ -11,11 +11,7 @@ const Invite = require('../structures/Invite');
|
||||
* The DataResolver identifies different objects and tries to resolve a specific piece of information from them.
|
||||
* @private
|
||||
*/
|
||||
class DataResolver {
|
||||
constructor() {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
class DataResolver extends null {
|
||||
/**
|
||||
* Data that can be resolved to give an invite code. This can be:
|
||||
* * An invite code
|
||||
|
||||
@@ -9,11 +9,7 @@ let INCREMENT = 0;
|
||||
/**
|
||||
* A container for useful snowflake-related methods.
|
||||
*/
|
||||
class SnowflakeUtil {
|
||||
constructor() {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
class SnowflakeUtil extends null {
|
||||
/**
|
||||
* A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z
|
||||
* ```
|
||||
|
||||
@@ -31,11 +31,7 @@
|
||||
/**
|
||||
* Allows for the extension of built-in Discord.js structures that are instantiated by {@link BaseManager Managers}.
|
||||
*/
|
||||
class Structures {
|
||||
constructor() {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
class Structures extends null {
|
||||
/**
|
||||
* Retrieves a structure class.
|
||||
* @param {string} structure Name of the structure to retrieve
|
||||
|
||||
@@ -10,11 +10,7 @@ const isObject = d => typeof d === 'object' && d !== null;
|
||||
/**
|
||||
* Contains various general-purpose utility methods.
|
||||
*/
|
||||
class Util {
|
||||
constructor() {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
class Util extends null {
|
||||
/**
|
||||
* Flatten an object. Any properties that are collections will get converted to an array of keys.
|
||||
* @param {Object} obj The object to flatten.
|
||||
|
||||
Reference in New Issue
Block a user