Skip to content

Commit

Permalink
fix dtslint errors on typescript@4.7, closes #1722
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Jun 12, 2022
1 parent 01ecb13 commit 34b28fa
Show file tree
Hide file tree
Showing 21 changed files with 10,089 additions and 186 deletions.
6 changes: 3 additions & 3 deletions dtslint/ts3.5/Array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ pipe(x2s, _.sortBy([ord2, ord3])) // $ExpectType X2[]
// Do
//

// $ExpectType { readonly a: number; readonly b: string; }[]
// $ExpectType { readonly a1: number; readonly a2: string; }[]
pipe(
_.Do,
_.bind('a', () => _.of(1)),
_.bind('b', () => _.of('b'))
_.bind('a1', () => _.of(1)),
_.bind('a2', () => _.of('b'))
)

//
Expand Down
29 changes: 17 additions & 12 deletions dtslint/ts3.5/Either.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,47 @@ flow(f, _.fromNullable('error'))('foo')
// do notation
//

// $ExpectType Either<string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
// $ExpectType Either<string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<string, number>(1),
_.bindTo('a'),
_.bind('b', () => _.right('b')),
_.bindW('c', () => _.right<number, boolean>(true))
_.bindTo('a1'),
_.bind('a2', () => _.right('b')),
_.bindW('a3', () => _.right<number, boolean>(true))
)

//
// pipeable sequence S
//

// $ExpectType Either<string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
pipe(_.right<string, number>(1), _.bindTo('a'), _.apS('b', _.right('b')), _.apSW('c', _.right<number, boolean>(true)))
// $ExpectType Either<string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<string, number>(1),
_.bindTo('a1'),
_.apS('a2', _.right('b')),
_.apSW('a3', _.right<number, boolean>(true))
)

//
// Do
//

// $ExpectType Either<string, { readonly a: number; readonly b: string; }>
// $ExpectType Either<string, { readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of<string, number>(1)),
_.bind('b', () => _.of<string, string>('b'))
_.bind('a1', () => _.of<string, number>(1)),
_.bind('a2', () => _.of<string, string>('b'))
)

//
// filterOrElseW
//

// $ExpectType Either<"a" | "b", number>
// $ExpectType Either<"a1" | "a2", number>
pipe(
_.left<'a', number>('a'),
_.left<'a1', number>('a1'),
_.filterOrElseW(
(result) => result > 0,
() => 'b' as const
() => 'a2' as const
)
)

Expand Down
6 changes: 3 additions & 3 deletions dtslint/ts3.5/IO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { pipe } from '../../src/function'
// Do
//

// $ExpectType IO<{ readonly a: number; readonly b: string; }>
// $ExpectType IO<{ readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of(1)),
_.bind('b', () => _.of('b'))
_.bind('a1', () => _.of(1)),
_.bind('a2', () => _.of('b'))
)
29 changes: 17 additions & 12 deletions dtslint/ts3.5/IOEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,41 +97,46 @@ pipe(
// do notation
//

// $ExpectType IOEither<string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
// $ExpectType IOEither<string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<string, number>(1),
_.bindTo('a'),
_.bind('b', () => _.right('b')),
_.bindW('c', () => _.right<number, boolean>(true))
_.bindTo('a1'),
_.bind('a2', () => _.right('b')),
_.bindW('a3', () => _.right<number, boolean>(true))
)

//
// pipeable sequence S
//

// $ExpectType IOEither<string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
pipe(_.right<string, number>(1), _.bindTo('a'), _.apS('b', _.right('b')), _.apSW('c', _.right<number, boolean>(true)))
// $ExpectType IOEither<string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<string, number>(1),
_.bindTo('a1'),
_.apS('a2', _.right('b')),
_.apSW('a3', _.right<number, boolean>(true))
)

//
// Do
//

// $ExpectType IOEither<string, { readonly a: number; readonly b: string; }>
// $ExpectType IOEither<string, { readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of<string, number>(1)),
_.bind('b', () => _.of<string, string>('b'))
_.bind('a1', () => _.of<string, number>(1)),
_.bind('a2', () => _.of<string, string>('b'))
)

//
// filterOrElseW
//

// $ExpectType IOEither<"a" | "b", number>
// $ExpectType IOEither<"a1" | "a2", number>
pipe(
_.left<'a', number>('a'),
_.left<'a1', number>('a1'),
_.filterOrElseW(
(result) => result > 0,
() => 'b' as const
() => 'a2' as const
)
)
6 changes: 3 additions & 3 deletions dtslint/ts3.5/Identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { pipe } from '../../src/function'
// Do
//

// $ExpectType { readonly a: number; readonly b: string; }
// $ExpectType { readonly a1: number; readonly a2: string; }
pipe(
_.Do,
_.bind('a', () => _.of(1)),
_.bind('b', () => _.of('b'))
_.bind('a1', () => _.of(1)),
_.bind('a2', () => _.of('b'))
)
6 changes: 3 additions & 3 deletions dtslint/ts3.5/NonEmptyArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ pipe(
// Do
//

// $ExpectType NonEmptyArray<{ readonly a: number; readonly b: string; }>
// $ExpectType NonEmptyArray<{ readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of(1)),
_.bind('b', () => _.of('b'))
_.bind('a1', () => _.of(1)),
_.bind('a2', () => _.of('b'))
)

//
Expand Down
6 changes: 3 additions & 3 deletions dtslint/ts3.5/Option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ flow(f, _.fromNullable)('foo')
// Do
//

// $ExpectType Option<{ readonly a: number; readonly b: string; }>
// $ExpectType Option<{ readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of(1)),
_.bind('b', () => _.of('b'))
_.bind('a1', () => _.of(1)),
_.bind('a2', () => _.of('b'))
)

// -------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions dtslint/ts3.5/Reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ pipe(
// Do
//

// $ExpectType Reader<string, { readonly a: number; readonly b: string; }>
// $ExpectType Reader<string, { readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of<string, number>(1)),
_.bind('b', () => _.of<string, string>('b'))
_.bind('a1', () => _.of<string, number>(1)),
_.bind('a2', () => _.of<string, string>('b'))
)
28 changes: 14 additions & 14 deletions dtslint/ts3.5/ReaderEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,46 +87,46 @@ pipe(
// do notation
//

// $ExpectType ReaderEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
// $ExpectType ReaderEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<{ readonly a: number }, string, number>(1),
_.bindTo('a'),
_.bind('b', () => _.right('b')),
_.bindW('c', () => _.right<{ readonly b: string }, number, boolean>(true))
_.bindTo('a1'),
_.bind('a2', () => _.right('b')),
_.bindW('a3', () => _.right<{ readonly b: string }, number, boolean>(true))
)

//
// pipeable sequence S
//

// $ExpectType ReaderEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
// $ExpectType ReaderEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<{ readonly a: number }, string, number>(1),
_.bindTo('a'),
_.apS('b', _.right('b')),
_.apSW('c', _.right<{ readonly b: string }, number, boolean>(true))
_.bindTo('a1'),
_.apS('a2', _.right('b')),
_.apSW('a3', _.right<{ readonly b: string }, number, boolean>(true))
)

//
// Do
//

// $ExpectType ReaderEither<unknown, string, { readonly a: number; readonly b: string; }>
// $ExpectType ReaderEither<unknown, string, { readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of<unknown, string, number>(1)),
_.bind('b', () => _.of<unknown, string, string>('b'))
_.bind('a1', () => _.of<unknown, string, number>(1)),
_.bind('a2', () => _.of<unknown, string, string>('b'))
)

//
// filterOrElseW
//

// $ExpectType ReaderEither<{ c: boolean; }, "a" | "b", number>
// $ExpectType ReaderEither<{ c: boolean; }, "a1" | "a2", number>
pipe(
_.left<{ c: boolean }, 'a', number>('a'),
_.left<{ c: boolean }, 'a1', number>('a1'),
_.filterOrElseW(
(result) => result > 0,
() => 'b' as const
() => 'a2' as const
)
)
6 changes: 3 additions & 3 deletions dtslint/ts3.5/ReaderTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { pipe } from '../../src/function'
// Do
//

// $ExpectType ReaderTask<unknown, { readonly a: number; readonly b: string; }>
// $ExpectType ReaderTask<unknown, { readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of<unknown, number>(1)),
_.bind('b', () => _.of<unknown, string>('b'))
_.bind('a1', () => _.of<unknown, number>(1)),
_.bind('a2', () => _.of<unknown, string>('b'))
)
28 changes: 14 additions & 14 deletions dtslint/ts3.5/ReaderTaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,46 +109,46 @@ pipe(
// do notation
//

// $ExpectType ReaderTaskEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
// $ExpectType ReaderTaskEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<{ readonly a: number }, string, number>(1),
_.bindTo('a'),
_.bind('b', () => _.right('b')),
_.bindW('c', () => _.right<{ readonly b: string }, number, boolean>(true))
_.bindTo('a1'),
_.bind('a2', () => _.right('b')),
_.bindW('a3', () => _.right<{ readonly b: string }, number, boolean>(true))
)

//
// pipeable sequence S
//

// $ExpectType ReaderTaskEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a: number; readonly b: string; readonly c: boolean; }>
// $ExpectType ReaderTaskEither<{ readonly a: number; } & { readonly b: string; }, string | number, { readonly a1: number; readonly a2: string; readonly a3: boolean; }>
pipe(
_.right<{ readonly a: number }, string, number>(1),
_.bindTo('a'),
_.apS('b', _.right('b')),
_.apSW('c', _.right<{ readonly b: string }, number, boolean>(true))
_.bindTo('a1'),
_.apS('a2', _.right('b')),
_.apSW('a3', _.right<{ readonly b: string }, number, boolean>(true))
)

//
// Do
//

// $ExpectType ReaderTaskEither<unknown, string, { readonly a: number; readonly b: string; }>
// $ExpectType ReaderTaskEither<unknown, string, { readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of<unknown, string, number>(1)),
_.bind('b', () => _.of<unknown, string, string>('b'))
_.bind('a1', () => _.of<unknown, string, number>(1)),
_.bind('a2', () => _.of<unknown, string, string>('b'))
)

//
// filterOrElseW
//

// $ExpectType ReaderTaskEither<{ c: boolean; }, "a" | "b", number>
// $ExpectType ReaderTaskEither<{ c: boolean; }, "a1" | "a2", number>
pipe(
_.left<{ c: boolean }, 'a', number>('a'),
_.left<{ c: boolean }, 'a1', number>('a1'),
_.filterOrElseW(
(result) => result > 0,
() => 'b' as const
() => 'a2' as const
)
)
6 changes: 3 additions & 3 deletions dtslint/ts3.5/ReadonlyArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ pipe(x2s, _.sortBy([ord2, ord3])) // $ExpectType ReadonlyArray<X2>
// Do
//

// $ExpectType readonly { readonly a: number; readonly b: string; }[]
// $ExpectType readonly { readonly a1: number; readonly a2: string; }[]
pipe(
_.Do,
_.bind('a', () => _.of(1)),
_.bind('b', () => _.of('b'))
_.bind('a1', () => _.of(1)),
_.bind('a2', () => _.of('b'))
)

//
Expand Down
6 changes: 3 additions & 3 deletions dtslint/ts3.5/ReadonlyNonEmptyArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ pipe(
// Do
//

// $ExpectType ReadonlyNonEmptyArray<{ readonly a: number; readonly b: string; }>
// $ExpectType ReadonlyNonEmptyArray<{ readonly a1: number; readonly a2: string; }>
pipe(
_.Do,
_.bind('a', () => _.of(1)),
_.bind('b', () => _.of('b'))
_.bind('a1', () => _.of(1)),
_.bind('a2', () => _.of('b'))
)

//
Expand Down
Loading

0 comments on commit 34b28fa

Please sign in to comment.