Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "xform/filter-fuzzy"

Index

Interfaces

Functions

Functions

filterFuzzy

  • filterFuzzy<A, B>(query: ArrayLike<B>, opts?: Partial<FilterFuzzyOpts<A, B>>): Transducer<A, A>
  • filterFuzzy<A, B>(query: ArrayLike<B>, src: Iterable<A>): IterableIterator<A>
  • filterFuzzy<A, B>(query: ArrayLike<B>, opts: Partial<FilterFuzzyOpts<A, B>>, src: Iterable<A>): IterableIterator<A>
  • Returns transducer which calls {@link @thi.ng/arrays#fuzzyMatch} for each value and discards all non-matching values.

    remarks

    The key option function can be used to extract/produce the actual value used for the search. The equiv option predicate can be used to customize item equality checking. Uses {@link @thi.ng/equiv#equiv} by default.

    example
    [...filterFuzzy("ho", ["hello", "hallo", "hey", "heyoka"])]
    // ["hello", "hallo", "heyoka"]

    Type parameters

    • A

    • B

    Parameters

    Returns Transducer<A, A>

  • Type parameters

    • A

    • B

    Parameters

    • query: ArrayLike<B>
    • src: Iterable<A>

    Returns IterableIterator<A>

  • Type parameters

    • A

    • B

    Parameters

    Returns IterableIterator<A>

Generated using TypeDoc