JSPM

  • Created
  • Published
  • Downloads 3180
  • Score
    100M100P100Q129523F
  • License MIT

An immutable Set where each element can occur multiple times

Package Exports

  • @rimbu/multiset

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rimbu/multiset) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@rimbu/multiset

A Rimbu MultiSet is a Set-like structure where each unique element can be added multiple times. Each element in the MultiSet occurs one or more times. The MultiSet keeps track of the amount of times an element was added.

This package exports the following main types:

Name Description
HashMultiSet<T> a MultiSet with hashed elements of type T
MultiSet<T> a generic MultiSet with elements of type T
SortedMultiSet<T> a MultiSet with sorted elements of type T
VariantMultiSet<T> a type-variant MultiSet with elements of type T

For complete documentation please visit the Rimbu Docs.

Or Try Me Out in CodeSandBox.

Installation

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

To install separately:

yarn add @rimbu/multiset

or

npm i @rimbu/multiset

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 { SortedMultiSet } from '@rimbu/multiset';

console.log(SortedMultiSet.of(1, 3, 2, 3, 2, 3).toString());

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.