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

x/rimbu/proximity/mod.ts

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

Variables

Sensible default distance function, based on ===

Functions

Given an Iterable of [key, value] entries, applies the distance function to each key, finding the one closest to the input key, also returning its associated value as well as the related distance; returns undefined only when there are no successful match - that is, all the keys have +inf distance.

Interfaces

A type-invariant immutable Map of key type K, and value type V. In the Map, each key has exactly one value, and the Map cannot contain duplicate keys. See the Map documentation and the ProximityMap API documentation

A mutable ProximityMap builder used to efficiently create new immutable instances. See the Map documentation and the ProximityMap.Builder API documentation

A context instance for a ProximityMap that acts as a factory for every instance of this type of collection.

A non-empty type-invariant immutable Map of key type K, and value type V. In the Map, each key has exactly one value, and the Map cannot contain duplicate keys. See the Map documentation and the ProximityMap API documentation

Utility interface that provides higher-level types for this collection.

Type Aliases

The distance between two values; a non-negative real number between:

Measures the distance between two values.

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