Skip to main content
Module

x/rimbu/typical/mod.ts>U.Extends

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

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