@discordjs/collection
Advanced tools
Comparing version 0.8.0-dev.1654862701-0415300 to 0.8.0-dev.1654906189-c7391db
@@ -31,2 +31,4 @@ "use strict"; | ||
return this.get(key); | ||
if (typeof defaultValueGenerator !== "function") | ||
throw new TypeError(`${defaultValueGenerator} is not a function.`); | ||
const defaultValue = defaultValueGenerator(key, this); | ||
@@ -114,2 +116,4 @@ this.set(key, defaultValue); | ||
find(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -124,2 +128,4 @@ fn = fn.bind(thisArg); | ||
findKey(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -134,2 +140,4 @@ fn = fn.bind(thisArg); | ||
sweep(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -145,2 +153,4 @@ fn = fn.bind(thisArg); | ||
filter(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -156,2 +166,4 @@ fn = fn.bind(thisArg); | ||
partition(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -177,2 +189,4 @@ fn = fn.bind(thisArg); | ||
map(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -187,2 +201,4 @@ fn = fn.bind(thisArg); | ||
mapValues(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -196,2 +212,4 @@ fn = fn.bind(thisArg); | ||
some(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -206,2 +224,4 @@ fn = fn.bind(thisArg); | ||
every(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -216,2 +236,4 @@ fn = fn.bind(thisArg); | ||
reduce(fn, initialValue) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
let accumulator; | ||
@@ -239,2 +261,4 @@ if (typeof initialValue !== "undefined") { | ||
each(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
this.forEach(fn, thisArg); | ||
@@ -244,2 +268,4 @@ return this; | ||
tap(fn, thisArg) { | ||
if (typeof fn !== "function") | ||
throw new TypeError(`${fn} is not a function`); | ||
if (typeof thisArg !== "undefined") | ||
@@ -246,0 +272,0 @@ fn = fn.bind(thisArg); |
{ | ||
"name": "@discordjs/collection", | ||
"version": "0.8.0-dev.1654862701-0415300", | ||
"version": "0.8.0-dev.1654906189-c7391db", | ||
"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
139921
1133