Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fixes #27

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: fix for pre-existing errors that creeped into commit for test
ashwinkjoseph committed Oct 31, 2021
commit bf2c0a54b763523bd7b8c3af32c4ceafea5b1f7a
2 changes: 1 addition & 1 deletion src/util/async.ts
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ export const createGroupableAsyncFunction = <
}
} catch (err) {
for (const call of cs) {
call.reject(err);
err instanceof Error && call.reject(err);
}
}
};
8 changes: 5 additions & 3 deletions src/util/index.ts
Original file line number Diff line number Diff line change
@@ -5,9 +5,11 @@ export const isDefined = <T>(v: T | null | undefined): v is T =>
* Strict version of Object.entries() that has a more useful key type,
* and filters out entries where the value is undefined
*/
export const definedEntries = <K extends string, V>(o: {
[key in K]?: V;
}): Array<[K, V]> =>
export const definedEntries = <K extends string, V>(
o: {
[key in K]?: V;
}
): Array<[K, V]> =>
[...(Object.entries(o) as [K, V][])].filter(([_k, v]) => isDefined(v));

export const delay = (ms: number): Promise<unknown> =>