Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(node): deprecate node 16 #200

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main-health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '16.x', '18.x' ]
node: [ '18.x' ] # This package cannot be tested under node 20+ in cicd due to the changed formatting system. See Readme.
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '16.x', '18.x' ]
node: [ '18.x' ] # This package cannot be tested under node 20+ in cicd due to the changed formatting system. See Readme.
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ message** section in the [contribution guidelines](./CONTRIBUTING.md).

<br />

## Node 20 and above.

This package has been updated to be compatible with Node 20 and Node 22, however since the JSON error messages changed in these versions, automated testing for these versions is not possible.

When Node 18 is EOL, test targets for 20 and 22 will be added.

## 🏆 Contributing

See [contributing guidelines](./CONTRIBUTING.md)
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ function jsonParseContext(serialized, reviver, opts) {
try {
return JSON.parse(serialized, reviver);
} catch (e) {
const syntaxErr = e.message.match(/^unexpected .*position\s+(\d+)/i);
const syntaxErr = e.message.match(/^unexpected .*position\s+(\d+)/i)
|| e.message.match(/^expected .*at position\s+(\d+)/i);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This format supports node 20 and 22, although its not possible to run the tests against these until node18 is EOL

const endOfJsonErr = e.message.match(/^unexpected end of json.*/i) ? serialized.length - 1 : null;
const errIdx = syntaxErr
? +syntaxErr[1]
Expand Down
Loading
Loading