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

x/rimbu/proximity/main/index.ts>NearestKeyMatch

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

Match between a reference key and the closest key in a [key, value] collection:

  • key is the key closest to the reference key

  • value is the value associated with the closest key

  • distance is the distance between the closest key and the reference key; it is always a finite value

definition: Readonly<{ key: K; value: V; distance: Distance; }>