@discordjs/collection
Advanced tools
Comparing version 0.8.0-dev.1654776336-94bdcac to 0.8.0-dev.1654819806-2791c86
@@ -28,3 +28,2 @@ /** | ||
declare class Collection<K, V> extends Map<K, V> { | ||
static readonly default: typeof Collection; | ||
/** | ||
@@ -431,2 +430,2 @@ * Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator. | ||
export { Collection, CollectionConstructor, Comparator, Keep, ReadonlyCollection, Collection as default }; | ||
export { Collection, CollectionConstructor, Comparator, Keep, ReadonlyCollection }; |
@@ -6,3 +6,2 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
@@ -22,6 +21,2 @@ var __export = (target, all) => { | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
@@ -31,7 +26,6 @@ // src/index.ts | ||
__export(src_exports, { | ||
Collection: () => Collection, | ||
default: () => src_default | ||
Collection: () => Collection | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var _Collection = class extends Map { | ||
var Collection = class extends Map { | ||
ensure(key, defaultValueGenerator) { | ||
@@ -271,3 +265,3 @@ if (this.has(key)) | ||
} | ||
sort(compareFunction = _Collection.defaultSort) { | ||
sort(compareFunction = Collection.defaultSort) { | ||
const entries = [...this.entries()]; | ||
@@ -324,3 +318,3 @@ entries.sort((a, b) => compareFunction(a[1], b[1], a[0], b[0])); | ||
} | ||
sorted(compareFunction = _Collection.defaultSort) { | ||
sorted(compareFunction = Collection.defaultSort) { | ||
return new this.constructor[Symbol.species](this).sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk)); | ||
@@ -335,3 +329,3 @@ } | ||
static combineEntries(entries, combine) { | ||
const coll = new _Collection(); | ||
const coll = new Collection(); | ||
for (const [k, v] of entries) { | ||
@@ -347,6 +341,3 @@ if (coll.has(k)) { | ||
}; | ||
var Collection = _Collection; | ||
__name(Collection, "Collection"); | ||
__publicField(Collection, "default", _Collection); | ||
var src_default = Collection; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -353,0 +344,0 @@ 0 && (module.exports = { |
{ | ||
"name": "@discordjs/collection", | ||
"version": "0.8.0-dev.1654776336-94bdcac", | ||
"version": "0.8.0-dev.1654819806-2791c86", | ||
"description": "Utility data structure used in discord.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
133795
1081