Skip to content
Myr

fix(types): fix 4.9.8 regression (#4448)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* move error check * add test * format

authored by Aadit Olkar · committed by GitHub · parent cc8868d · Browse files · 2 files+11 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−6 removed

  • tests:+5 added−0 removed
  • other:+6 added−6 removed

2 files+11 added−6 removed

modified:src/utils/types.test.ts+5 added
58 unmodified lines
59 type Actual = JSONParsed<{ a: { toJSON(): number } }>60 type Expected = { a: number }61 expectTypeOf<Actual>().toEqualTypeOf<Expected>()62 })63 it('should convert invalid type with { toJSON() => T to T', () => {64 type Actual = JSONParsed<bigint & { toJSON(): string }>65 type Expected = string66 expectTypeOf<Actual>().toEqualTypeOf<Expected>()67 })68 })6970 describe('invalid types', () => {71 it('should convert undefined type to never', () => {
213 unmodified lines
modified:src/utils/types.ts+6 added-6 removed