1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

setting nodes on flow\

This commit is contained in:
muerwre 2019-08-25 11:04:28 +07:00
parent 4a7fe884f9
commit 4c49ed000a
4 changed files with 16 additions and 9 deletions

View file

@ -4,3 +4,5 @@ import nth from 'ramda/es/nth';
import remove from 'ramda/es/remove';
export const moveArrItem = curry((at, to, list) => insert(to, nth(at, list), remove(at, 1, list)));
export const objFromArray = (array: any[], key: string) =>
array.reduce((obj, el) => (key && el[key] ? { ...obj, [el[key]]: el } : obj), {});