refactor: remove extended collection (#6246)

Co-authored-by: iCrawl <buechler.noel@outlook.com>
This commit is contained in:
1Computer1
2021-07-31 07:08:59 -04:00
committed by GitHub
parent 65ae06429d
commit 00bae4fe6b
49 changed files with 56 additions and 75 deletions

View File

@@ -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}
*/

View File

@@ -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

View File

@@ -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();
}
}

View File

@@ -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');