Skip to content

Commit

Permalink
Upgrade TypeScript and tslib to the latest versions (#17)
Browse files Browse the repository at this point in the history
We need TypeScript 4.6+ to be able to construct Error objects with the
cause property[1]. The property is useful to chain errors and, on the
catching side, to see what error caused the error we just caught.

I want to have this in place to implement [3] which satisfies a need we
ourselves have[4].

tslib upgraded in lockstep because otherwise we get

    FAIL  test/result.test.ts
      ● Test suite failed to run

        test/result.test.ts:121:29 - error TS2807: This syntax requires an imported helper named '__spreadArray' with 3 parameters, which is not compatible with the one in 'tslib'. Consider upgrading your version of 'tslib'.

        121     const all4 = Result.all(...([] as Result<string, number>[]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error
[2] microsoft/TypeScript#45167
[3] vultix#34
[4] vultix#48
  • Loading branch information
jstasiak authored Mar 29, 2022
1 parent 014a8e8 commit cc14388
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"prettier": "^2.2.1",
"rxjs": "^6.6.7",
"ts-jest": "^26.5.4",
"tslib": "^2.1.0",
"typescript": "^4.2"
"tslib": "^2.3.1",
"typescript": "^4.6.3"
}
}

0 comments on commit cc14388

Please sign in to comment.