mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
This commit adds support for passing options as an object to fs.writeSync,
matching Node.js behavior. Previously, Bun only supported positional
parameters (fd, buffer, offset, length, position). Now it also accepts:
fs.writeSync(fd, buffer, { offset, length, position })
The fix properly validates the options and throws ERR_OUT_OF_RANGE when
offset or length values exceed the buffer bounds.
Fixes the test-fs-write-sync-optional-params.js Node.js test.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>