This consolidates duplicate functions that were scattered across the codebase:
1. **Platform detection functions** (isWindows, isLinux, isMacOS, isPosix)
- Created internal/platform.ts module for built-in JS modules
- Updated test files to import from harness instead of redefining
2. **Patch test snapshot normalization**
- Created harness-patch.ts for shared normalizeBunSnapshotForPatch
- Consolidated identical implementations from 2 test files
3. **Removed inline isLinux redefinition**
- net.ts was defining isLinux twice, now uses shared import
Files affected:
- src/js/internal/platform.ts (new shared module)
- src/js/internal/fs/glob.ts (use shared isWindows)
- src/js/node/net.ts (use shared isWindows and isLinux)
- test/harness-patch.ts (new shared test utility)
- test/cli/install/bun-install-patch.test.ts
- test/regression/issue/patch-bounds-check.test.ts
- test/js/node/test/common/index.js
- test/napi/node-napi-tests/test/common/index.js
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>