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

x/rimbu/typical/mod.ts>Num.Min

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

Returns the smallest of the given 2 natural numbers, of never otherwise

Examples

Example 1

Min<2, 5> => 2
Min<534, 424> => 424
Min<-4, 4> => never

Type Parameters

N1 extends number
N2 extends number
definition: N1 extends never ? never : N2 extends never ? never : Subtract<N1 & U.Check<N1>, N2 & U.Check<N2>> extends never ? N1 : N2