(self: Instruction)
| 1119 | /** @internal */ |
| 1120 | export const getNames = (self: Instruction): Array<string> => { |
| 1121 | const loop = (self: Instruction): ReadonlyArray<string> => { |
| 1122 | switch (self._tag) { |
| 1123 | case "Empty": { |
| 1124 | return Arr.empty() |
| 1125 | } |
| 1126 | case "Single": { |
| 1127 | return Arr.prepend(self.aliases, self.name) |
| 1128 | } |
| 1129 | case "KeyValueMap": |
| 1130 | case "Variadic": { |
| 1131 | return loop(self.argumentOption as Instruction) |
| 1132 | } |
| 1133 | case "Map": |
| 1134 | case "WithDefault": |
| 1135 | case "WithFallback": { |
| 1136 | return loop(self.options as Instruction) |
| 1137 | } |
| 1138 | case "Both": |
| 1139 | case "OrElse": { |
| 1140 | const left = loop(self.left as Instruction) |
| 1141 | const right = loop(self.right as Instruction) |
| 1142 | return Arr.appendAll(left, right) |
| 1143 | } |
| 1144 | } |
| 1145 | } |
| 1146 | const order = Order.mapInput( |
| 1147 | Order.boolean, |
| 1148 | (tuple: [boolean, string]) => !tuple[0] |
no test coverage detected