Interface FuseRankedOptions<T>

How to fuse.

interface FuseRankedOptions<T> {
    idOf: ((item) => string);
    k?: number;
    weights?: readonly number[];
    perList?: number | readonly number[];
    groupOf?: ((item) => string);
    perGroup?: number;
    limit?: number;
}

Type Parameters

  • T

Properties

idOf: ((item) => string)

An item's id: items with the same id in different lists are one item.

Type declaration

    • (item): string
    • Parameters

      • item: T

      Returns string

k?: number

The smoothing constant.

Default

60
weights?: readonly number[]

Each list's weight by the list's place, a finite number, zero or more; a list with none weighs 1.

perList?: number | readonly number[]

The most items kept whose first list is a given list: one number for every list, or one a list by place. A cap is a whole number, zero or more, or positive infinity for no cap.

groupOf?: ((item) => string)

An item's group, which perGroup counts.

Type declaration

    • (item): string
    • Parameters

      • item: T

      Returns string

perGroup?: number

The most items kept of one group, a whole number, zero or more, or positive infinity; needs groupOf.

limit?: number

The most items answered, a whole number, zero or more, or positive infinity.