-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cebd26d
commit 1238a1c
Showing
5 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import type { Base } from '../../core/helpers.js' | ||
import type { Base, MaybeThunk } from '../../core/helpers.js' | ||
import type { Named } from '../typeGroups.js' | ||
import type { Nullable } from './Nullable.js' | ||
|
||
type InnerType = Named | Nullable<any> | List<any> | ||
|
||
export type List<$Type extends InnerType> = Base.List<$Type> | ||
|
||
export const List = <$Type extends InnerType>(type: $Type): List<$Type> => ({ | ||
export const List = <$Type extends InnerType>(type: MaybeThunk<$Type>): List<$Type> => ({ | ||
kind: `list`, | ||
type, | ||
// at type level "type" is not a thunk | ||
type: type as any, // eslint-disable-line | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters