Repository navigation
Commit b80941d
authored
refactor: simplify block decoder dispatch (#1697)
Switch directly on the decoded `type` field in the block, block element,
accessory, and context element decoders. Remove four redundant temporary
strings and their empty-string checks.
Route unknown blocks through the same decode-and-append path as known
blocks, preserving their raw JSON, ordering, and error behavior. This
removes 25 lines without changing behavior or the public API.
Validation: existing block and accessory tests pass, including
unknown-block round trips and malformed input. Formatting, lint, module,
and whitespace checks also pass.1 parent 11eb9d3 commit b80941d
1 file changed
Lines changed: 7 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 39 | | |
45 | | - | |
| 40 | + | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
| |||
94 | 89 | | |
95 | 90 | | |
96 | 91 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 92 | + | |
103 | 93 | | |
104 | 94 | | |
105 | 95 | | |
| |||
214 | 204 | | |
215 | 205 | | |
216 | 206 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 207 | | |
223 | | - | |
| 208 | + | |
224 | 209 | | |
225 | 210 | | |
226 | 211 | | |
| |||
260 | 245 | | |
261 | 246 | | |
262 | 247 | | |
263 | | - | |
| 248 | + | |
264 | 249 | | |
265 | 250 | | |
266 | 251 | | |
| |||
301 | 286 | | |
302 | 287 | | |
303 | 288 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 289 | + | |
310 | 290 | | |
311 | 291 | | |
312 | 292 | | |
| |||
457 | 437 | | |
458 | 438 | | |
459 | 439 | | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
| 440 | + | |
466 | 441 | | |
467 | 442 | | |
468 | 443 | | |
| |||
478 | 453 | | |
479 | 454 | | |
480 | 455 | | |
481 | | - | |
| 456 | + | |
482 | 457 | | |
483 | 458 | | |
484 | 459 | | |
| |||
0 commit comments