Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/common/comp.ts>Comp.invert

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Comp.invert
import { Comp } from "https://deno.land/x/rimbu@1.0.4/common/comp.ts";
const { invert } = Comp;

Returns a Comp instance the reverses the order of the given comp instance.

Examples

Example 1

const c = Comp.invert(Comp.numberComp())
console.log(c.compare(3, 5) > 0)
// => true
console.log(c.compare(5, 5))
// => 0

Parameters

comp: Comp<T>
  • the Comp instance to wrap