Commit ed91fcf
committed
fix(init): add size guard and deduplicate JSON minification in preReadCommonFiles
- Add stat check before reading files in preReadCommonFiles, skipping
files larger than MAX_FILE_BYTES (256KB). Prevents memory spikes
from large files like Gemfile.lock.
- Extract minifyJson() helper and use it in both preReadCommonFiles
and readSingleFile to eliminate duplicated JSON.stringify(JSON.parse())
logic.
Made-with: Cursor1 parent f997526 commit ed91fcf
1 file changed
+15
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
387 | 396 | | |
388 | 397 | | |
389 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
390 | 403 | | |
391 | 404 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
| 405 | + | |
397 | 406 | | |
398 | 407 | | |
399 | 408 | | |
| |||
540 | 549 | | |
541 | 550 | | |
542 | 551 | | |
543 | | - | |
544 | 552 | | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
| 553 | + | |
550 | 554 | | |
551 | 555 | | |
552 | 556 | | |
| |||
0 commit comments