mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
6a1abbf3db
* initial implementation * take vcs as a parameter (so it's easier to mock and test) * update console log and exit early if not logged in * add unit tests for migration * add async filter and replace vcs find by root document * lint fix * fix memory driver and add test for hasProjectForRootDocument * setup check on interval * move migration logic and interval from main process to render process, because session state and a VCS instance dont work in the main process yet * update test * replace constructor with static class creator * replace interval with login logout hook * remove effect helpers * empty commit to trigger CI
5 lines
232 B
TypeScript
5 lines
232 B
TypeScript
export const asyncFilter = async <T>(arr: T[], predicate: (value: T, index: number, arr: T[]) => Promise<boolean>) => {
|
|
const results = await Promise.all(arr.map(predicate));
|
|
return arr.filter((_v, index) => results[index]);
|
|
};
|