UNPKG

@ayonli/jsext

Version:

A JavaScript extension package for building strong and modern applications.

17 lines (16 loc) 1.03 kB
import { Sequence } from "../types.ts"; /** * Performs a shallow compare to another sequence and see if it contains the same elements as * this sequence. */ export declare function equals<T>(arr1: Sequence<T>, arr2: Sequence<T>): boolean; /** Checks if the sequence contains another sequence as a slice of its contents. */ export declare function includeSlice<T>(arr: Sequence<T>, slice: Sequence<T>): boolean; /** Checks if the sequence starts with the given prefix. */ export declare function startsWith<T>(arr: Sequence<T>, prefix: Sequence<T>): boolean; /** Checks if the sequence ends with the given suffix. */ export declare function endsWith<T>(arr: Sequence<T>, suffix: Sequence<T>): boolean; /** Breaks the sequence into smaller chunks according to the given delimiter. */ export declare function split<T>(arr: Sequence<T>, delimiter: T): Sequence<T>[]; /** Breaks the sequence into smaller chunks according to the given length. */ export declare function chunk<T>(arr: Sequence<T>, length: number): Sequence<T>[];