| 2 | const log = getLogger("graph:ShimCollection"); |
| 3 | |
| 4 | function addToMap(name, fromMap, toMap) { |
| 5 | /* Dynamically populate the given map "toMap" with the following structure: |
| 6 | <module-id>: [{ |
| 7 | name: <shim-name>, |
| 8 | shim: <shim-configuration> |
| 9 | }, { |
| 10 | name: <shim-name>, |
| 11 | shim: <shim-configuration> |
| 12 | }, ...] |
| 13 | */ |
| 14 | for (const [moduleId, shim] of Object.entries(fromMap)) { |
| 15 | if (!toMap[moduleId]) { |
| 16 | toMap[moduleId] = []; |
| 17 | } |
| 18 | toMap[moduleId].push({ |
| 19 | name, |
| 20 | shim |
| 21 | }); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | class ShimCollection { |
| 26 | constructor() { |