()
| 143 | const byId = new Map(); |
| 144 | let pending = []; |
| 145 | const flush = async () => { |
| 146 | const inputs = []; |
| 147 | for (const c of pending) inputs.push(c.input); |
| 148 | const internalByEntry = await buildBatch(inputs, mode); |
| 149 | for (const [k, c] of pending.entries()) { |
| 150 | byId.set(c.id, internalByEntry.get(k) || []); |
| 151 | } |
| 152 | pending = []; |
| 153 | }; |
| 154 | for (const c of tokenizerCases) { |
| 155 | pending.push(c); |
| 156 | if (pending.length === BATCH) await flush(); |
no test coverage detected