Skip to content

Restore null options support - #169

Open
awais-ur-rehman wants to merge 1 commit into
jprichardson:masterfrom
awais-ur-rehman:feat/restore-null-options
Open

awais-ur-rehman wants to merge 1 commit into
jprichardson:masterfrom
awais-ur-rehman:feat/restore-null-options

Conversation

@awais-ur-rehman

Copy link
Copy Markdown

Summary

Passing null as options throws at options.fs, although the native fs methods accept it and #24 documented support for this behavior. Normalize only null in the four file methods. Six regression cases cover callback, promise, and synchronous reads and writes; the existing encoding-string and custom-fs behavior is retained.

Related to #24; this is a regression against that historical behavior.

Breaking Changes

None.

Testing

  • npm test: 56 tests and Standard lint pass. The six null-option cases fail on the base commit.
  • npm pack --ignore-scripts --dry-run passes.
  • To reproduce, read or write a temporary JSON file with null options using each callback, promise, and synchronous API.

Prepared with OpenAI Codex assistance.

@RyanZim

RyanZim commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

This change was explicitly mentioned as a breaking change for v6.0.0: https://github.com/jprichardson/node-jsonfile/blob/master/CHANGELOG.md#600--2020-02-24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants