revamped db schema and implemented some simple api

This commit is contained in:
Dave Horton committed 2019-12-02 16:49:25 -05:00
1 parent 8c287f06df
commit 47bb642854
19 files changed
+1005 -592

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
function scrubIds(tuples) {
return tuples.map((t) => {
delete t.id;
return t;
});
}
function rewriteKeys(tuples, obj) {
return tuples.map((t) => {
Object.keys(obj).forEach((k) => {
if (k in t) {
t[obj[k]] = t[k];
delete t[k];
}
});
});
}
module.exports = {
scrubIds,
rewriteKeys
};