buddy

node MVC discord bot
Log | Files | Refs | README

Collection.js (401B)


      1 'use strict';
      2 
      3 const BaseCollection = require('@discordjs/collection');
      4 const Util = require('./Util');
      5 
      6 class Collection extends BaseCollection {
      7   toJSON() {
      8     return this.map(e => (typeof e.toJSON === 'function' ? e.toJSON() : Util.flatten(e)));
      9   }
     10 }
     11 
     12 module.exports = Collection;
     13 
     14 /**
     15  * @external Collection
     16  * @see {@link https://discord.js.org/#/docs/collection/master/class/Collection}
     17  */