Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/rimbu/typical/num.ts>Decr

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

Decreases a positive number by 1, or if the number is not positive, returns never.

Examples

Example 1

Dec<5> => 4
Dec<434> => 433
Dec<0> => never

Type Parameters

N extends number
definition: Subtract<N, 1>