mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
refactor: remove extended collection (#6246)
Co-authored-by: iCrawl <buechler.noel@outlook.com>
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const { Collection: BaseCollection } = require('@discordjs/collection');
|
||||
const Util = require('./Util');
|
||||
|
||||
class Collection extends BaseCollection {
|
||||
toJSON() {
|
||||
return this.map(e => (typeof e?.toJSON === 'function' ? e.toJSON() : Util.flatten(e)));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Collection;
|
||||
|
||||
/**
|
||||
* @external Collection
|
||||
* @see {@link https://discord.js.org/#/docs/collection/master/class/Collection}
|
||||
*/
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const Collection = require('./Collection.js');
|
||||
const { Collection } = require('@discordjs/collection');
|
||||
|
||||
/**
|
||||
* A Collection which holds a max amount of entries. The first key is deleted if the Collection has
|
||||
|
||||
@@ -173,7 +173,7 @@ class Options extends null {
|
||||
* });
|
||||
*/
|
||||
static cacheWithLimits(settings = {}) {
|
||||
const Collection = require('./Collection');
|
||||
const { Collection } = require('@discordjs/collection');
|
||||
const LimitedCollection = require('./LimitedCollection');
|
||||
const SweptCollection = require('./SweptCollection');
|
||||
|
||||
@@ -197,7 +197,7 @@ class Options extends null {
|
||||
* @returns {CacheFactory}
|
||||
*/
|
||||
static cacheEverything() {
|
||||
const Collection = require('./Collection');
|
||||
const { Collection } = require('@discordjs/collection');
|
||||
return () => new Collection();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const Collection = require('./Collection.js');
|
||||
const { Collection } = require('@discordjs/collection');
|
||||
const { _cleanupSymbol } = require('./Constants.js');
|
||||
const { TypeError } = require('../errors/DJSError.js');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user