import { type MultiSetBase } from "https://deno.land/x/rimbu@1.0.3/multiset/custom/index.ts";
const { Builder } = MultiSetBase;
Methods
addAll(values: StreamSource<T>): boolean
Adds the values in given values
StreamSource
to the builder.
addEntries(entries: StreamSource<readonly [T, number]>): boolean
Adds for each tuple of a value and amount in the given entries
, the amount of values
to the builder.
setCount(value: T, amount: number): boolean
Sets the amount of given value
in the collection to amount
.
modifyCount(value: T, update: (currentCount: number) => number): boolean
Changes the amount of given value
in the builder according to the result of given update
function.