UNPKG

@beenotung/tslib

Version:
18 lines (17 loc) 571 B
/** * @description this module is for better performance by reducing the need to invoke string.substring() and array.slice() * */ export interface ArrayString { s: string; offset: number; length: number; } export declare const wrapString: (s: string) => ArrayString; export interface ArrayData<A> { s: string | A[]; offset: number; length: number; } export declare const wrapArray: <A>(s: string | A[]) => ArrayData<A>; export declare const pop: <A>(x: ArrayData<A>) => ArrayData<A>; export declare const wrappedLast: <A>(x: ArrayData<A>) => A;