Skip to content

Commit

Permalink
Upgrade TypeScript and tslib to the latest versions
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 committed Mar 29, 2022
1 parent ffcadad commit 92eb0ad
Show file tree
Hide file tree
Showing 2 changed files with 11,742 additions and 5,175 deletions.
Loading

0 comments on commit 92eb0ad

Please sign in to comment.