Skip to content

Commit 68b860a

Browse files
authored
update vitest and node version (#1947)
1 parent eb7c025 commit 68b860a

File tree

137 files changed

+3298
-4764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+3298
-4764
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@typescript-eslint/member-delimiter-style": 0,
1515
"@typescript-eslint/no-non-null-assertion": "off",
1616
"@typescript-eslint/ban-types": "off",
17+
"@typescript-eslint/ban-ts-comment": "off",
1718
"@typescript-eslint/no-explicit-any": "off",
1819
"@typescript-eslint/no-empty-interface": "off",
1920
"no-unused-vars": "off",

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [16.17.1]
18+
node-version: [20.12.2]
1919

2020
steps:
2121
- uses: actions/checkout@v2

docs/modules/Identity.ts.md

+30-14
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Added in v2.0.0
1414

1515
- [Extract](#extract)
1616
- [extract](#extract)
17+
- [combinators](#combinators)
18+
- [tap](#tap)
1719
- [constructors](#constructors)
1820
- [of](#of)
1921
- [do notation](#do-notation)
@@ -45,13 +47,13 @@ Added in v2.0.0
4547
- [getShow](#getshow)
4648
- [legacy](#legacy)
4749
- [chain](#chain)
50+
- [chainFirst](#chainfirst)
4851
- [mapping](#mapping)
4952
- [flap](#flap)
5053
- [map](#map)
5154
- [model](#model)
5255
- [Identity (type alias)](#identity-type-alias)
5356
- [sequencing](#sequencing)
54-
- [chainFirst](#chainfirst)
5557
- [flatMap](#flatmap)
5658
- [flatten](#flatten)
5759
- [traversing](#traversing)
@@ -83,6 +85,21 @@ export declare const extract: <A>(wa: A) => A
8385
8486
Added in v2.6.2
8587
88+
# combinators
89+
90+
## tap
91+
92+
Composes computations in sequence, using the return value of one computation to determine the next computation and
93+
keeping only the result of the first.
94+
95+
**Signature**
96+
97+
```ts
98+
export declare const tap: { <A, _>(self: A, f: (a: A) => _): A; <A, _>(f: (a: A) => _): (self: A) => A }
99+
```
100+
101+
Added in v2.16.7
102+
86103
# constructors
87104
88105
## of
@@ -363,6 +380,18 @@ export declare const chain: <A, B>(f: (a: A) => B) => (ma: A) => B
363380
364381
Added in v2.0.0
365382
383+
## chainFirst
384+
385+
Alias of `tap`
386+
387+
**Signature**
388+
389+
```ts
390+
export declare const chainFirst: <A, B>(f: (a: A) => B) => (first: A) => A
391+
```
392+
393+
Added in v2.0.0
394+
366395
# mapping
367396
368397
## flap
@@ -402,19 +431,6 @@ Added in v2.0.0
402431
403432
# sequencing
404433
405-
## chainFirst
406-
407-
Composes computations in sequence, using the return value of one computation to determine the next computation and
408-
keeping only the result of the first.
409-
410-
**Signature**
411-
412-
```ts
413-
export declare const chainFirst: <A, B>(f: (a: A) => B) => (first: A) => A
414-
```
415-
416-
Added in v2.0.0
417-
418434
## flatMap
419435
420436
**Signature**

docs/modules/Json.ts.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ import * as E from 'fp-ts/Either'
7373
import { pipe } from 'fp-ts/function'
7474

7575
assert.deepStrictEqual(pipe('{"a":1}', J.parse), E.right({ a: 1 }))
76-
assert.deepStrictEqual(pipe('{"a":}', J.parse), E.left(new SyntaxError('Unexpected token } in JSON at position 5')))
76+
assert.deepStrictEqual(
77+
pipe('{"a":}', J.parse),
78+
E.left(new SyntaxError(`Unexpected token '}', "{"a":}" is not valid JSON`))
79+
)
7780
```
7881

7982
Added in v2.10.0

dtslint/ts3.5/Applicative.ts dtslint/Applicative.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as _ from '../../src/Applicative'
2-
import * as E from '../../src/Either'
3-
import * as S from '../../src/Semigroup'
4-
import * as R from '../../src/Reader'
1+
import * as _ from '../src/Applicative'
2+
import * as E from '../src/Either'
3+
import * as R from '../src/Reader'
4+
import * as S from '../src/Semigroup'
55

66
//
77
// getApplicativeComposition

dtslint/ts3.5/Apply.ts dtslint/Apply.ts

+21-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
import * as _ from '../../src/Apply'
2-
import { URIS, Kind } from '../../src/HKT'
3-
import * as RTE from '../../src/ReaderTaskEither'
4-
import * as E from '../../src/Either'
5-
import { pipe } from '../../src/function'
6-
import * as Fu from '../../src/Functor'
1+
import * as _ from '../src/Apply'
2+
import * as E from '../src/Either'
3+
import { pipe } from '../src/function'
4+
import * as Fu from '../src/Functor'
5+
import { Kind, URIS } from '../src/HKT'
6+
import * as RTE from '../src/ReaderTaskEither'
77

88
//
99
// apS
1010
//
1111

12-
export const apS = <F extends URIS>(F: _.Apply1<F>) => (
13-
s: Kind<F, string>,
14-
n: Kind<F, number>
15-
): Kind<F, { s: string; n: number }> => {
16-
const apS = _.apS(F)
17-
const bindTo = Fu.bindTo(F)
18-
return pipe(s, bindTo('s'), apS('n', n))
19-
}
12+
export const apS =
13+
<F extends URIS>(F: _.Apply1<F>) =>
14+
(s: Kind<F, string>, n: Kind<F, number>): Kind<F, { s: string; n: number }> => {
15+
const apS = _.apS(F)
16+
const bindTo = Fu.bindTo(F)
17+
return pipe(s, bindTo('s'), apS('n', n))
18+
}
2019

2120
//
2221
// sequenceS
@@ -35,9 +34,9 @@ declare const sequenceS4: E.Either<boolean, void>
3534

3635
const sequenceSf1 = _.sequenceS(E.either)
3736

38-
// $ExpectError
37+
// @ts-expect-error
3938
sequenceSf1({})
40-
// $ExpectError
39+
// @ts-expect-error
4140
sequenceSf1({ sequenceS1, sequenceS4 })
4241

4342
sequenceSf1({ sequenceS1, sequenceS2, sequenceS3 }) // $ExpectType Either<string, { sequenceS1: number; sequenceS2: string; sequenceS3: boolean; }>
@@ -49,9 +48,9 @@ declare const sequenceS7: RTE.ReaderTaskEither<{ a: number }, string, boolean>
4948
declare const sequenceS8: RTE.ReaderTaskEither<{ a: number }, boolean, void>
5049
declare const sequenceS9: RTE.ReaderTaskEither<{ a: string }, string, void>
5150

52-
// $ExpectError
51+
// @ts-expect-error
5352
sequenceSf2({ sequenceS5, sequenceS8 })
54-
// $ExpectError
53+
// @ts-expect-error
5554
sequenceSf2({ sequenceS5, sequenceS9 })
5655

5756
sequenceSf2({ sequenceS5, sequenceS6, sequenceS7 }) // $ExpectType ReaderTaskEither<{ a: number; }, string, { sequenceS5: number; sequenceS6: string; sequenceS7: boolean; }>
@@ -68,18 +67,18 @@ sequenceSf2({ sequenceS5, sequenceS6, sequenceS7 }) // $ExpectType ReaderTaskEit
6867

6968
const sequenceTf1 = _.sequenceT(E.either)
7069

71-
// $ExpectError
70+
// @ts-expect-error
7271
sequenceTf1([])
73-
// $ExpectError
72+
// @ts-expect-error
7473
sequenceTf1(sequenceS1, sequenceS4)
7574

7675
sequenceTf1(sequenceS1, sequenceS2, sequenceS3) // $ExpectType Either<string, [number, string, boolean]>
7776

7877
const sequenceTf2 = _.sequenceT(RTE.readerTaskEither)
7978

80-
// $ExpectError
79+
// @ts-expect-error
8180
sequenceTf2(sequenceS5, sequenceS8)
82-
// $ExpectError
81+
// @ts-expect-error
8382
sequenceTf2(sequenceS5, sequenceS9)
8483

8584
sequenceTf2(sequenceS5, sequenceS6, sequenceS7) // $ExpectType ReaderTaskEither<{ a: number; }, string, [number, string, boolean]>

dtslint/ts3.5/Array.ts dtslint/Array.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as _ from '../../src/Array'
2-
import { identity, pipe } from '../../src/function'
3-
import * as N from '../../src/number'
4-
import { Ord } from '../../src/Ord'
5-
import * as E from '../../src/Either'
1+
import * as _ from '../src/Array'
2+
import * as E from '../src/Either'
3+
import { identity, pipe } from '../src/function'
4+
import * as N from '../src/number'
5+
import { Ord } from '../src/Ord'
66

77
declare const us: Array<unknown>
88
declare const ns: Array<number>
@@ -177,7 +177,7 @@ pipe(
177177
prns,
178178
_.filter(
179179
(
180-
x // $ExpectType number
180+
_x // $ExpectType number
181181
) => true
182182
)
183183
)
@@ -195,8 +195,8 @@ pipe(
195195
prns,
196196
_.filterWithIndex(
197197
(
198-
i, // $ExpectType number
199-
x // $ExpectType number
198+
_i, // $ExpectType number
199+
_x // $ExpectType number
200200
) => true
201201
)
202202
)
@@ -216,7 +216,7 @@ pipe(
216216
prns,
217217
_.partition(
218218
(
219-
x // $ExpectType number
219+
_x // $ExpectType number
220220
) => true
221221
)
222222
)
@@ -236,8 +236,8 @@ pipe(
236236
prns,
237237
_.partitionWithIndex(
238238
(
239-
i, // $ExpectType number
240-
x // $ExpectType number
239+
_i, // $ExpectType number
240+
_x // $ExpectType number
241241
) => true
242242
)
243243
)

dtslint/ts3.5/Console.ts dtslint/Console.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as _ from '../../src/Console'
2-
import { flow, pipe } from '../../src/function'
3-
import * as TE from '../../src/TaskEither'
1+
import * as _ from '../src/Console'
2+
import { flow, pipe } from '../src/function'
3+
import * as TE from '../src/TaskEither'
44

55
// $ExpectType TaskEither<never, string>
66
pipe(TE.right('a'), TE.chainFirst(flow(_.error, TE.fromIO)))

dtslint/ts3.5/Const.ts dtslint/Const.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as _ from '../../src/Const'
1+
import * as _ from '../src/Const'
22

33
//
44
// contramap

dtslint/ts3.5/Either.ts dtslint/Either.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as _ from '../../src/Either'
2-
import { pipe, flow, identity } from '../../src/function'
3-
import * as RA from '../../src/ReadonlyArray'
1+
import * as _ from '../src/Either'
2+
import { flow, identity, pipe } from '../src/function'
3+
import * as RA from '../src/ReadonlyArray'
44

55
//
66
// getOrElseW
@@ -122,7 +122,7 @@ pipe(
122122
n,
123123
_.fromPredicate(
124124
(
125-
n // $ExpectType number
125+
_n // $ExpectType number
126126
) => true,
127127
() => false
128128
)
@@ -147,7 +147,7 @@ pipe(
147147
en,
148148
_.filterOrElse(
149149
(
150-
n // $ExpectType number
150+
_n // $ExpectType number
151151
) => true,
152152
() => false
153153
)
@@ -157,5 +157,5 @@ pipe(
157157
// exists
158158
//
159159

160-
declare const es: _.Either<string, number>[]
161-
const x = pipe(es, RA.filter(_.exists((n) => n > 0)))
160+
declare const es: Array<_.Either<string, number>>
161+
pipe(es, RA.filter(_.exists((n) => n > 0)))

dtslint/ts3.5/Eq.ts dtslint/Eq.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as _ from '../../src/Eq'
2-
import * as S from '../../src/string'
3-
import * as N from '../../src/number'
4-
import * as B from '../../src/boolean'
1+
import * as B from '../src/boolean'
2+
import * as _ from '../src/Eq'
3+
import * as N from '../src/number'
4+
import * as S from '../src/string'
55

66
//
77
// struct
+10-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import * as _ from '../../src/Functor'
2-
import * as RA from '../../src/ReadonlyArray'
3-
import * as E from '../../src/Either'
4-
import * as RTE from '../../src/ReaderTaskEither'
1+
import * as E from '../src/Either'
2+
import * as _ from '../src/Functor'
3+
import * as RTE from '../src/ReaderTaskEither'
4+
import * as RA from '../src/ReadonlyArray'
55

66
// $ExpectType <A, B>(f: (a: A) => B) => (fa: readonly (readonly A[])[]) => readonly (readonly B[])[]
7-
const F11 = _.map(RA.Functor, RA.Functor)
7+
export const F11 = _.map(RA.Functor, RA.Functor)
88

99
// $ExpectType <A, B>(f: (a: A) => B) => <E>(fa: readonly Either<E, A>[]) => readonly Either<E, B>[]
10-
const F12 = _.map(RA.Functor, E.Functor)
10+
export const F12 = _.map(RA.Functor, E.Functor)
1111

1212
// $ExpectType <A, B>(f: (a: A) => B) => <R, E>(fa: readonly ReaderTaskEither<R, E, A>[]) => readonly ReaderTaskEither<R, E, B>[]
13-
const F13 = _.map(RA.Functor, RTE.Functor)
13+
export const F13 = _.map(RA.Functor, RTE.Functor)
1414

1515
// $ExpectType <A, B>(f: (a: A) => B) => <E>(fa: Either<E, readonly A[]>) => Either<E, readonly B[]>
16-
const F21 = _.map(E.Functor, RA.Functor)
16+
export const F21 = _.map(E.Functor, RA.Functor)
1717

1818
// $ExpectType <A, B>(f: (a: A) => B) => <EF, EG>(fa: Either<EF, Either<EG, A>>) => Either<EF, Either<EG, B>>
19-
const F22 = _.map(E.Functor, E.Functor)
19+
export const F22 = _.map(E.Functor, E.Functor)
2020

2121
// $ExpectType <A, B>(f: (a: A) => B) => <R, E>(fa: ReaderTaskEither<R, E, readonly A[]>) => ReaderTaskEither<R, E, readonly B[]>
22-
const F31 = _.map(RTE.Functor, RA.Functor)
22+
export const F31 = _.map(RTE.Functor, RA.Functor)

dtslint/ts3.5/IO.ts dtslint/IO.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as _ from '../../src/IO'
2-
import { pipe } from '../../src/function'
1+
import { pipe } from '../src/function'
2+
import * as _ from '../src/IO'
33

44
//
55
// Do

dtslint/ts3.5/IOEither.ts dtslint/IOEither.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as _ from '../../src/IOEither'
2-
import * as IO from '../../src/IO'
3-
import * as E from '../../src/Either'
4-
import { pipe } from '../../src/function'
1+
import * as E from '../src/Either'
2+
import { pipe } from '../src/function'
3+
import * as IO from '../src/IO'
4+
import * as _ from '../src/IOEither'
55

66
//
77
// getOrElseW

dtslint/ts3.5/Identity.ts dtslint/Identity.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as _ from '../../src/Identity'
2-
import { pipe } from '../../src/function'
1+
import { pipe } from '../src/function'
2+
import * as _ from '../src/Identity'
33

44
//
55
// Do

0 commit comments

Comments
 (0)