@discordjs/collection
Advanced tools
Comparing version 2.1.1-dev.1721866226-bf6761a44 to 2.1.1-dev.1722211856-785ec8fd7
@@ -310,3 +310,4 @@ /** | ||
*/ | ||
reduce<InitialValue = Value>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue?: InitialValue): InitialValue; | ||
reduce(fn: (accumulator: Value, value: Value, key: Key, collection: this) => Value, initialValue?: Value): Value; | ||
reduce<InitialValue>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue: InitialValue): InitialValue; | ||
/** | ||
@@ -319,3 +320,4 @@ * Applies a function to produce a single value. Identical in behavior to | ||
*/ | ||
reduceRight<InitialValue>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue?: InitialValue): InitialValue; | ||
reduceRight(fn: (accumulator: Value, value: Value, key: Key, collection: this) => Value, initialValue?: Value): Value; | ||
reduceRight<InitialValue>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue: InitialValue): InitialValue; | ||
/** | ||
@@ -322,0 +324,0 @@ * Identical to |
@@ -257,14 +257,2 @@ "use strict"; | ||
} | ||
/** | ||
* Applies a function to produce a single value. Identical in behavior to | ||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce | Array.reduce()}. | ||
* | ||
* @param fn - Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`, | ||
* and `collection` | ||
* @param initialValue - Starting value for the accumulator | ||
* @example | ||
* ```ts | ||
* collection.reduce((acc, guild) => acc + guild.memberCount, 0); | ||
* ``` | ||
*/ | ||
reduce(fn, initialValue) { | ||
@@ -285,9 +273,2 @@ if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`); | ||
} | ||
/** | ||
* Applies a function to produce a single value. Identical in behavior to | ||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight | Array.reduceRight()}. | ||
* | ||
* @param fn - Function used to reduce, taking four arguments; `accumulator`, `value`, `key`, and `collection` | ||
* @param initialValue - Starting value for the accumulator | ||
*/ | ||
reduceRight(fn, initialValue) { | ||
@@ -582,3 +563,3 @@ if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`); | ||
// src/index.ts | ||
var version = "2.1.1-dev.1721866226-bf6761a44"; | ||
var version = "2.1.1-dev.1722211856-785ec8fd7"; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -585,0 +566,0 @@ 0 && (module.exports = { |
{ | ||
"$schema": "https://json.schemastore.org/package.json", | ||
"name": "@discordjs/collection", | ||
"version": "2.1.1-dev.1721866226-bf6761a44", | ||
"version": "2.1.1-dev.1722211856-785ec8fd7", | ||
"description": "Utility data structure used in discord.js", | ||
@@ -65,4 +65,4 @@ "exports": { | ||
"vitest": "^1.6.0", | ||
"@discordjs/api-extractor": "^7.38.1", | ||
"@discordjs/scripts": "^0.1.0" | ||
"@discordjs/scripts": "^0.1.0", | ||
"@discordjs/api-extractor": "^7.38.1" | ||
}, | ||
@@ -69,0 +69,0 @@ "engines": { |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
215037
1637