UNPKG

status-sharding

Version:

Welcome to Status Sharding! This package is designed to provide an efficient and flexible solution for sharding Discord bots, allowing you to scale your bot across multiple processes or workers.

38 lines 985 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class CustomMap extends Map { update(key, value) { return this.set(key, value(this.get(key))); } map(callback) { const arr = []; for (const [key, value] of this) { arr.push(callback(value, key, this)); } return arr; } filter(callback) { const arr = []; for (const [key, value] of this) { if (callback(value, key, this)) arr.push(value); } return arr; } find(callback) { for (const [key, value] of this) { if (callback(value, key, this)) return value; } return undefined; } every(callback) { for (const [key, value] of this) { if (!callback(value, key, this)) return false; } return true; } } exports.default = CustomMap; //# sourceMappingURL=map.js.map