(fields: FieldsConfig, map?: KeyMap)
| 48 | > |
| 49 | |
| 50 | const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { |
| 51 | if (!map) { |
| 52 | map = new Map() |
| 53 | } |
| 54 | |
| 55 | for (const config of fields) { |
| 56 | if ("in" in config) { |
| 57 | if (config.key) { |
| 58 | map.set(config.key, { |
| 59 | in: config.in, |
| 60 | map: config.map, |
| 61 | }) |
| 62 | } |
| 63 | } else if (config.args) { |
| 64 | buildKeyMap(config.args, map) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return map |
| 69 | } |
| 70 | |
| 71 | interface Params { |
| 72 | body: unknown |
no test coverage detected