mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
* refactor(INJI-503): remove unused locales Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * refactor(INJI-394): modify prop in VCItemContent Remove passing iconType & iconName props in VCItemContent which is used to check if pinned or not to isPinned boolean prop Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * feat(INJI-349): show pinned vc on top in QRLogin screen Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * feat(INJI-349): show pinned vc on top in VCShare screen Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * refactor(INJI-349): add type annotation to groupBy method Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * refactor(INJI-449): create machine based on first selected vc in share screen Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * refactor(INJI-394): extract method for vcs ordering by pin status Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> --------- Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
15 lines
313 B
TypeScript
15 lines
313 B
TypeScript
export function groupBy<T>(array: T[], predicate: (arg0: T) => boolean) {
|
|
const trueElements: T[] = [];
|
|
const falseElements: T[] = [];
|
|
|
|
array?.forEach(e => {
|
|
if (predicate(e)) {
|
|
trueElements.push(e);
|
|
} else {
|
|
falseElements.push(e);
|
|
}
|
|
});
|
|
|
|
return [trueElements, falseElements];
|
|
}
|