@supercharge/collections
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -187,3 +187,3 @@ import { QueueItem } from './contracts'; | ||
*/ | ||
groupBy(key: string): Promise<any>; | ||
groupBy(key: keyof T): Promise<any>; | ||
/** | ||
@@ -497,3 +497,3 @@ * Determines whether the the collection contains the item | ||
*/ | ||
then<R = T[]>(onFullfilled: (value: R) => unknown, onRejected: (value: any) => unknown): Promise<void>; | ||
then<R = T[]>(onFullfilled: (value: R) => unknown, onRejected: (reason: any) => unknown): Promise<R | undefined>; | ||
/** | ||
@@ -500,0 +500,0 @@ * Processes the collection pipeline and returns the result. |
@@ -499,4 +499,7 @@ 'use strict'; | ||
async then(onFullfilled, onRejected) { | ||
await Promise.all([]); | ||
try { | ||
onFullfilled(await this.all()); | ||
const result = await this.all(); | ||
onFullfilled(result); | ||
return result; | ||
} | ||
@@ -503,0 +506,0 @@ catch (error) { |
{ | ||
"name": "@supercharge/collections", | ||
"description": "async/await-ready array methods for JavaScript and Node.js", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"author": "Marcus Pöhls <marcus@superchargejs.com>", | ||
@@ -17,3 +17,3 @@ "bugs": { | ||
"eslint": "~7.32.0", | ||
"expect": "~27.4.6", | ||
"expect": "~27.5.1", | ||
"typescript": "~4.4.4", | ||
@@ -20,0 +20,0 @@ "uvu": "~0.5.3" |
103960
15
3311