OmitIntersection
Returns a subset of an intersection without specified components.
Params
Name | Type | Description |
---|---|---|
input | any | The intersection to omit from. |
to_omit | any | The components to omit. |
Example
luau
type Result = OmitIntersection<
"hello" & string & "world",
"world"
>
-- type Result = "hello" & string
PickIntersection
Returns a subset of an intersection with only specified components.
Params
Name | Type | Description |
---|---|---|
input | any | The intersection to pick from. |
to_pick | any | The components to pick. |
Example
luau
type Result = PickIntersection<
"hello" & string & "world",
"world"
>
-- type Result = "world"
FlattenIntersection
Combines nested intersections into one intersection.
Params
Name | Type | Description |
---|---|---|
input | any | The intersection to flatten. |
Example
luau
type Result = FlattenIntersection<"foo" & ("hello" & ("world" & "lol"))>
-- type Result = "foo" & "hello" & "lol" & "world"
CleanIntersection
Removes duplicate types from an intersection.
Params
Name | Type | Description |
---|---|---|
input | any | The intersection to clean. |
Example
luau
type Result = CleanIntersection<"hello" & string & "world" & string & "foo" & "hello">
-- type Result = "foo" & "hello" & "world" & string