mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
18 lines
401 B
JavaScript
18 lines
401 B
JavaScript
'use strict';
|
|
|
|
const 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}
|
|
*/
|