Skip to content
Myr

fix(types): handle readonly array correctly (#3172)

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

authored by m-shaka · committed by GitHub · parent a285c4b · Browse files · 2 files+7 added−0 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+7 added−0 removed

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

2 files+7 added−0 removed

modified:src/utils/types.test.ts+5 added
99 unmodified lines
100 type Actual = JSONParsed<(number | undefined)[]>101 type Expected = (number | null)[]102 expectTypeOf<Actual>().toEqualTypeOf<Expected>()103 })104 it('should convert { key: readonly T[]} correctly', () => {105 type Actual = JSONParsed<{ key: readonly number[] }>106 type Expected = { key: readonly number[] }107 expectTypeOf<Actual>().toEqualTypeOf<Expected>()108 })109 })110111 describe('tuple', () => {112 it('should convert [T, S] type to [T, S]', () => {
105 unmodified lines
modified:src/utils/types.ts+2 added