Map model commands to the generator's command-entry shape.
(model)
| 787 | |
| 788 | /** Map model commands to the generator's command-entry shape. */ |
| 789 | function modelToCommands(model) { |
| 790 | const commands = [] |
| 791 | for (const [domain, entry] of Object.entries(model)) { |
| 792 | for (const c of entry.commands) { |
| 793 | commands.push({ |
| 794 | domain, |
| 795 | methodStr: c.method, |
| 796 | methodName: c.name, |
| 797 | paramsTypeName: c.params !== null ? normalizeDottedName(c.params) : null, |
| 798 | hasParams: c.params !== null, |
| 799 | resultTypeName: c.result !== null ? normalizeDottedName(c.result) : null, |
| 800 | }) |
| 801 | } |
| 802 | } |
| 803 | return commands |
| 804 | } |
| 805 | |
| 806 | /** Map model events to the generator's event-entry shape. */ |
| 807 | function modelToEvents(model) { |
no test coverage detected