Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/typical/utils.ts>Extends

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias Extends
import { type Extends } from "https://deno.land/x/rimbu@1.0.2/typical/utils.ts";

If A extends B, returns Then (default true) or else Else (default false)

Examples

Example 1

Extends<1, number> => true
Extends<1, string> => false
Extends<1, number, 'a', 'b'> => 'a'
Extends<1, string, 'a', 'b'> => 'b'

Type Parameters

A
B
optional
Then = true
optional
Else = false
definition: A extends B ? Then : Else