New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rimbu/bimap

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rimbu/bimap

A bidirectional immutable Map of keys and values for TypeScript

0.5.4
Source
npm
Version published
Weekly downloads
2.3K
18.98%
Maintainers
1
Weekly downloads
 
Created
Source

@rimbu/bimap

A BiMap is a bidirectional Map of keys and values, where each key has exactly one value, and each value has exactly one key. There is a one-to-one mapping between keys and values.

This package exports the following types:

NameDescription
BiMap<K, V>a generic BiMap between keys of type K and values of type V
HashBiMap<K, V>a BiMap implementation where keys and values are hashed
SortedBiMap<K, V>a BiMap implementation where keys and values are sorted

For complete documentation please visit the Rimbu Docs.

Installation

All types are exported through @rimbu/core. It is recommended to use this package.

To install separately:

yarn add @rimbu/bimap

or

npm i @rimbu/bimap

Rimbu uses advanced and recursive typing, potentially making the TypeScript compiler quite slow in some cases, or causing infinite recursion. It is recommended to set the following values in the tsconfig.json file of your project:

{
  //  ...
  "compilerOptions": {
    // ...
    "skipLibCheck": true,
    "noStrictGenericChecks": true
  }
}

Usage

import { HashBiMap } from '@rimbu/bimap';

const biMap = HashBiMap.of([1, 'a'], [2, 'b'], [3, 'b']);
console.log(biMap.toString());
// HashBiMap(3 -> b)

Author

Arvid Nicolaas

Contributing

Feel very welcome to contribute to further improve Rimbu. Please read our Contributing guide.

Contributors

Made with contributors-img.

License

Licensed under the MIT License, Copyright © 2020-present Arvid Nicolaas.

See LICENSE for more information.

Keywords

bimap

FAQs

Package last updated on 06 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts