(obj, prefix)
| 50 | ]); |
| 51 | |
| 52 | function prefixKeys(obj, prefix) { |
| 53 | let newObj = {}; |
| 54 | for (let [key, value] of Object.entries(obj)) { |
| 55 | let newKey = `${prefix}.${key}`; |
| 56 | if (mapToNewKeys[newKey]) { |
| 57 | newKey = mapToNewKeys[newKey]; |
| 58 | } |
| 59 | newObj[newKey] = value; |
| 60 | } |
| 61 | return newObj; |
| 62 | } |
| 63 | |
| 64 | // remove properties from an object if they are not in the set of strings to allow |
| 65 | function filterKeys(obj) { |