Skip to content

Commit

Permalink
chore(node): deprecate node 16 (#200)
Browse files Browse the repository at this point in the history
Take minor bumps from dependabot
  • Loading branch information
code-forger authored Jan 8, 2025
1 parent 66d0c96 commit f8f8835
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 130 deletions.
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);
const endOfJsonErr = e.message.match(/^unexpected end of json.*/i) ? serialized.length - 1 : null;
const errIdx = syntaxErr
? +syntaxErr[1]
Expand Down
Loading

0 comments on commit f8f8835

Please sign in to comment.