(fields: FieldsConfig, map?: KeyMap)
| 63 | > |
| 64 | |
| 65 | const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { |
| 66 | if (!map) { |
| 67 | map = new Map() |
| 68 | } |
| 69 | |
| 70 | for (const config of fields) { |
| 71 | if ("in" in config) { |
| 72 | if (config.key) { |
| 73 | map.set(config.key, { |
| 74 | in: config.in, |
| 75 | map: config.map, |
| 76 | }) |
| 77 | } |
| 78 | } else if ("key" in config) { |
| 79 | map.set(config.key, { |
| 80 | map: config.map, |
| 81 | }) |
| 82 | } else if (config.args) { |
| 83 | buildKeyMap(config.args, map) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | return map |
| 88 | } |
| 89 | |
| 90 | interface Params { |
| 91 | body: unknown |
no test coverage detected