mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-01-25 02:08:24 +00:00
24 lines
341 B
JavaScript
24 lines
341 B
JavaScript
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
|
|
};
|