(command: Respondable, count: number)
| 257 | const remainingRepliesMap = new WeakMap<Respondable, number>(); |
| 258 | |
| 259 | function fillSubCommand(command: Respondable, count: number) { |
| 260 | let remainingReplies = remainingRepliesMap.has(command) |
| 261 | ? remainingRepliesMap.get(command) |
| 262 | : command.args.length; |
| 263 | |
| 264 | remainingReplies -= 1; |
| 265 | |
| 266 | if (remainingReplies <= 0) { |
| 267 | command.resolve(count); |
| 268 | remainingRepliesMap.delete(command); |
| 269 | return true; |
| 270 | } |
| 271 | remainingRepliesMap.set(command, remainingReplies); |
| 272 | return false; |
| 273 | } |
| 274 | |
| 275 | function fillUnsubCommand(command: Respondable, count: number) { |
| 276 | let remainingReplies = remainingRepliesMap.has(command) |
no test coverage detected
searching dependent graphs…