api update

This commit is contained in:
tmshv committed 2020-02-15 01:58:42 +03:00
1 parent 502a314c68
commit 99b412ea8d
19 files changed
+684

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
/**
*
* f([x, y, z, ...]) -> f(v) -> {v.x, v.y, v.z}
*
* @param fields
* @returns {function(*): *}
*/
export function select(fields=[]){
return i => fields.reduce((out, key) => {
out[key] = i[key];
return out;
}, {});
}