Commit f824310
committed
vfs: DRY up setup.js handler boilerplate
Extract common patterns into shared helpers to reduce repetition
in the VFS fs-handler registration code:
- toPathStr(): replaces ~40 occurrences of URL-to-string resolution
- findVFSWith/findVFSWithAsync(): generic exists+try/catch+mounted
lookup, replacing 11 nearly-identical findVFSFor* functions
- noopPathSync/noopFdSync: shared no-op handlers for chmod/chown/
utimes-style operations (13 handlers consolidated)
Also fixes .pathname usage in rename/copyFile/link handlers to use
fileURLToPath() for correct percent-encoding handling.
Reduces setup.js from 1524 to 1080 lines (-29%).1 parent bc19ec8 commit f824310
1 file changed
Lines changed: 279 additions & 722 deletions
0 commit comments