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

update vitest and node version #1947

Merged
merged 4 commits into from
Jul 7, 2024
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
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off",
"no-unused-vars": "off",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [16.17.1]
node-version: [20.12.2]

steps:
- uses: actions/checkout@v2
Expand Down
44 changes: 30 additions & 14 deletions docs/modules/Identity.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Added in v2.0.0

- [Extract](#extract)
- [extract](#extract)
- [combinators](#combinators)
- [tap](#tap)
- [constructors](#constructors)
- [of](#of)
- [do notation](#do-notation)
Expand Down Expand Up @@ -45,13 +47,13 @@ Added in v2.0.0
- [getShow](#getshow)
- [legacy](#legacy)
- [chain](#chain)
- [chainFirst](#chainfirst)
- [mapping](#mapping)
- [flap](#flap)
- [map](#map)
- [model](#model)
- [Identity (type alias)](#identity-type-alias)
- [sequencing](#sequencing)
- [chainFirst](#chainfirst)
- [flatMap](#flatmap)
- [flatten](#flatten)
- [traversing](#traversing)
Expand Down Expand Up @@ -83,6 +85,21 @@ export declare const extract: <A>(wa: A) => A

Added in v2.6.2

# combinators

## tap

Composes computations in sequence, using the return value of one computation to determine the next computation and
keeping only the result of the first.

**Signature**

```ts
export declare const tap: { <A, _>(self: A, f: (a: A) => _): A; <A, _>(f: (a: A) => _): (self: A) => A }
```

Added in v2.16.7

# constructors

## of
Expand Down Expand Up @@ -363,6 +380,18 @@ export declare const chain: <A, B>(f: (a: A) => B) => (ma: A) => B

Added in v2.0.0

## chainFirst

Alias of `tap`

**Signature**

```ts
export declare const chainFirst: <A, B>(f: (a: A) => B) => (first: A) => A
```

Added in v2.0.0

# mapping

## flap
Expand Down Expand Up @@ -402,19 +431,6 @@ Added in v2.0.0

# sequencing

## chainFirst

Composes computations in sequence, using the return value of one computation to determine the next computation and
keeping only the result of the first.

**Signature**

```ts
export declare const chainFirst: <A, B>(f: (a: A) => B) => (first: A) => A
```

Added in v2.0.0

## flatMap

**Signature**
Expand Down
5 changes: 4 additions & 1 deletion docs/modules/Json.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ import * as E from 'fp-ts/Either'
import { pipe } from 'fp-ts/function'

assert.deepStrictEqual(pipe('{"a":1}', J.parse), E.right({ a: 1 }))
assert.deepStrictEqual(pipe('{"a":}', J.parse), E.left(new SyntaxError('Unexpected token } in JSON at position 5')))
assert.deepStrictEqual(
pipe('{"a":}', J.parse),
E.left(new SyntaxError(`Unexpected token '}', "{"a":}" is not valid JSON`))
)
```

Added in v2.10.0
Expand Down
8 changes: 4 additions & 4 deletions dtslint/ts3.5/Applicative.ts → dtslint/Applicative.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as _ from '../../src/Applicative'
import * as E from '../../src/Either'
import * as S from '../../src/Semigroup'
import * as R from '../../src/Reader'
import * as _ from '../src/Applicative'
import * as E from '../src/Either'
import * as R from '../src/Reader'
import * as S from '../src/Semigroup'

//
// getApplicativeComposition
Expand Down
43 changes: 21 additions & 22 deletions dtslint/ts3.5/Apply.ts → dtslint/Apply.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import * as _ from '../../src/Apply'
import { URIS, Kind } from '../../src/HKT'
import * as RTE from '../../src/ReaderTaskEither'
import * as E from '../../src/Either'
import { pipe } from '../../src/function'
import * as Fu from '../../src/Functor'
import * as _ from '../src/Apply'
import * as E from '../src/Either'
import { pipe } from '../src/function'
import * as Fu from '../src/Functor'
import { Kind, URIS } from '../src/HKT'
import * as RTE from '../src/ReaderTaskEither'

//
// apS
//

export const apS = <F extends URIS>(F: _.Apply1<F>) => (
s: Kind<F, string>,
n: Kind<F, number>
): Kind<F, { s: string; n: number }> => {
const apS = _.apS(F)
const bindTo = Fu.bindTo(F)
return pipe(s, bindTo('s'), apS('n', n))
}
export const apS =
<F extends URIS>(F: _.Apply1<F>) =>
(s: Kind<F, string>, n: Kind<F, number>): Kind<F, { s: string; n: number }> => {
const apS = _.apS(F)
const bindTo = Fu.bindTo(F)
return pipe(s, bindTo('s'), apS('n', n))
}

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

const sequenceSf1 = _.sequenceS(E.either)

// $ExpectError
// @ts-expect-error
sequenceSf1({})
// $ExpectError
// @ts-expect-error
sequenceSf1({ sequenceS1, sequenceS4 })

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

// $ExpectError
// @ts-expect-error
sequenceSf2({ sequenceS5, sequenceS8 })
// $ExpectError
// @ts-expect-error
sequenceSf2({ sequenceS5, sequenceS9 })

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

const sequenceTf1 = _.sequenceT(E.either)

// $ExpectError
// @ts-expect-error
sequenceTf1([])
// $ExpectError
// @ts-expect-error
sequenceTf1(sequenceS1, sequenceS4)

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

const sequenceTf2 = _.sequenceT(RTE.readerTaskEither)

// $ExpectError
// @ts-expect-error
sequenceTf2(sequenceS5, sequenceS8)
// $ExpectError
// @ts-expect-error
sequenceTf2(sequenceS5, sequenceS9)

sequenceTf2(sequenceS5, sequenceS6, sequenceS7) // $ExpectType ReaderTaskEither<{ a: number; }, string, [number, string, boolean]>
22 changes: 11 additions & 11 deletions dtslint/ts3.5/Array.ts → dtslint/Array.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as _ from '../../src/Array'
import { identity, pipe } from '../../src/function'
import * as N from '../../src/number'
import { Ord } from '../../src/Ord'
import * as E from '../../src/Either'
import * as _ from '../src/Array'
import * as E from '../src/Either'
import { identity, pipe } from '../src/function'
import * as N from '../src/number'
import { Ord } from '../src/Ord'

declare const us: Array<unknown>
declare const ns: Array<number>
Expand Down Expand Up @@ -177,7 +177,7 @@ pipe(
prns,
_.filter(
(
x // $ExpectType number
_x // $ExpectType number
) => true
)
)
Expand All @@ -195,8 +195,8 @@ pipe(
prns,
_.filterWithIndex(
(
i, // $ExpectType number
x // $ExpectType number
_i, // $ExpectType number
_x // $ExpectType number
) => true
)
)
Expand All @@ -216,7 +216,7 @@ pipe(
prns,
_.partition(
(
x // $ExpectType number
_x // $ExpectType number
) => true
)
)
Expand All @@ -236,8 +236,8 @@ pipe(
prns,
_.partitionWithIndex(
(
i, // $ExpectType number
x // $ExpectType number
_i, // $ExpectType number
_x // $ExpectType number
) => true
)
)
Expand Down
6 changes: 3 additions & 3 deletions dtslint/ts3.5/Console.ts → dtslint/Console.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as _ from '../../src/Console'
import { flow, pipe } from '../../src/function'
import * as TE from '../../src/TaskEither'
import * as _ from '../src/Console'
import { flow, pipe } from '../src/function'
import * as TE from '../src/TaskEither'

// $ExpectType TaskEither<never, string>
pipe(TE.right('a'), TE.chainFirst(flow(_.error, TE.fromIO)))
Expand Down
2 changes: 1 addition & 1 deletion dtslint/ts3.5/Const.ts → dtslint/Const.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '../../src/Const'
import * as _ from '../src/Const'

//
// contramap
Expand Down
14 changes: 7 additions & 7 deletions dtslint/ts3.5/Either.ts → dtslint/Either.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as _ from '../../src/Either'
import { pipe, flow, identity } from '../../src/function'
import * as RA from '../../src/ReadonlyArray'
import * as _ from '../src/Either'
import { flow, identity, pipe } from '../src/function'
import * as RA from '../src/ReadonlyArray'

//
// getOrElseW
Expand Down Expand Up @@ -122,7 +122,7 @@ pipe(
n,
_.fromPredicate(
(
n // $ExpectType number
_n // $ExpectType number
) => true,
() => false
)
Expand All @@ -147,7 +147,7 @@ pipe(
en,
_.filterOrElse(
(
n // $ExpectType number
_n // $ExpectType number
) => true,
() => false
)
Expand All @@ -157,5 +157,5 @@ pipe(
// exists
//

declare const es: _.Either<string, number>[]
const x = pipe(es, RA.filter(_.exists((n) => n > 0)))
declare const es: Array<_.Either<string, number>>
pipe(es, RA.filter(_.exists((n) => n > 0)))
8 changes: 4 additions & 4 deletions dtslint/ts3.5/Eq.ts → dtslint/Eq.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as _ from '../../src/Eq'
import * as S from '../../src/string'
import * as N from '../../src/number'
import * as B from '../../src/boolean'
import * as B from '../src/boolean'
import * as _ from '../src/Eq'
import * as N from '../src/number'
import * as S from '../src/string'

//
// struct
Expand Down
20 changes: 10 additions & 10 deletions dtslint/ts3.5/Functor.ts → dtslint/Functor.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import * as _ from '../../src/Functor'
import * as RA from '../../src/ReadonlyArray'
import * as E from '../../src/Either'
import * as RTE from '../../src/ReaderTaskEither'
import * as E from '../src/Either'
import * as _ from '../src/Functor'
import * as RTE from '../src/ReaderTaskEither'
import * as RA from '../src/ReadonlyArray'

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

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

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

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

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

// $ExpectType <A, B>(f: (a: A) => B) => <R, E>(fa: ReaderTaskEither<R, E, readonly A[]>) => ReaderTaskEither<R, E, readonly B[]>
const F31 = _.map(RTE.Functor, RA.Functor)
export const F31 = _.map(RTE.Functor, RA.Functor)
4 changes: 2 additions & 2 deletions dtslint/ts3.5/IO.ts → dtslint/IO.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _ from '../../src/IO'
import { pipe } from '../../src/function'
import { pipe } from '../src/function'
import * as _ from '../src/IO'

//
// Do
Expand Down
8 changes: 4 additions & 4 deletions dtslint/ts3.5/IOEither.ts → dtslint/IOEither.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as _ from '../../src/IOEither'
import * as IO from '../../src/IO'
import * as E from '../../src/Either'
import { pipe } from '../../src/function'
import * as E from '../src/Either'
import { pipe } from '../src/function'
import * as IO from '../src/IO'
import * as _ from '../src/IOEither'

//
// getOrElseW
Expand Down
4 changes: 2 additions & 2 deletions dtslint/ts3.5/Identity.ts → dtslint/Identity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _ from '../../src/Identity'
import { pipe } from '../../src/function'
import { pipe } from '../src/function'
import * as _ from '../src/Identity'

//
// Do
Expand Down
Loading
Loading