Skip to main content
Module

x/rimbu/mod.ts>Reducer.startsWithSlice

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Reducer.startsWithSlice
import { Reducer } from "https://deno.land/x/rimbu@1.2.0/mod.ts";
const { startsWithSlice } = Reducer;

Returns a Reducer that returns true if the first input values match the given slice values repeated amount times. Otherwise, returns false.

Parameters

slice: StreamSource<T>
  • a sequence of elements to match against
optional
options: { eq?: Eq<T> | undefined; amount?: number; } = [UNSUPPORTED]
  • (optional) an object containing the following properties:
  • amount: (detaulf: 1) the amount of elements to find
  • eq: (default: Eq.objectIs) the Eq instance to use to compare elements

Returns

Reducer<T, boolean>