Skip to content

OmitIntersection

Returns a subset of an intersection without specified components.

Params

NameTypeDescription
inputanyThe intersection to omit from.
to_omitanyThe 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

NameTypeDescription
inputanyThe intersection to pick from.
to_pickanyThe components to pick.

Example

luau
type Result = PickIntersection<
    "hello" & string & "world",
    "world"
>

-- type Result = "world"

FlattenIntersection

Combines nested intersections into one intersection.

Params

NameTypeDescription
inputanyThe 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

NameTypeDescription
inputanyThe intersection to clean.

Example

luau
type Result = CleanIntersection<"hello" & string & "world" & string & "foo" & "hello">

-- type Result = "foo" & "hello" & "world" & string