Skip to main content
Module

x/rimbu/mod.ts>Range

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
namespace Range
Re-export
import { Range } from "https://deno.land/x/rimbu@0.14.0/mod.ts";

Functions

Simplifies a given range Range input for easier processing, by returning optional start and end ranges including whether they are inclusive or exclusive

type alias Range
Re-export
import { type Range } from "https://deno.land/x/rimbu@0.14.0/mod.ts";

A range definition for any type of (orderable) value. If a start or end is defined, a tuple can be used where the second item is a boolean indicating whether that end is inclusive (true) or exclusive (false). A Range of type T can have one of the following forms:

  • { end: T }
  • { end: [T, boolean] }
  • { start: T }
  • { start: T, end: T }
  • { start: T, end: [T, boolean] }
  • { start: [T, boolean] }
  • { start: [T, boolean], end: T }
  • { start: [T, boolean], end: [T, boolean] }
definition: { start: T | [T, boolean]; end?: T | [T, boolean]; amount?: undefined; } | { start?: T | [T, boolean]; end: T | [T, boolean]; amount?: undefined; }