Skip to content

Commit

Permalink
Fix ArrayIfAlready type (#4331)
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad committed Mar 2, 2021
1 parent 887a4f6 commit 5d2db21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Expand Up @@ -70,7 +70,7 @@ interface Boxed<T> {
// If T can't be assigned to TBase fallback to an alternate type TAlt
type IncompatibleToAlt<T, TBase, TAlt> = T extends TBase ? T : TAlt;

type ArrayIfAlready<T1, T2> = T1 extends any[] ? T2[] : T2;
type ArrayIfAlready<T1, T2> = AnyToUnknown<T1> extends any[] ? T2[] : T2;

// Boxing is necessary to prevent distribution of conditional types:
// https://lorefnon.tech/2019/05/02/using-boxing-to-prevent-distribution-of-conditional-types/
Expand Down

0 comments on commit 5d2db21

Please sign in to comment.