UNPKG

@panyam/tsutils

Version:

Some basic TS utils for personal use

9 lines (8 loc) 692 B
export declare function encodeAs(value: number, alphabet: string): string; export declare function dictGet(dict: any, key: string, onmissing: any | ((key: string) => any)): any; export declare function ifDefined(value: any, elseVal?: null): any; export declare function stripQuotes(str: string): string; export declare function trimmedSplit(value: string | null, delimiter: string): string[]; export declare function ArrayTimesN<T = number>(count: number, value: T): T[]; export declare function firstIndexOf<T>(items: ReadonlyArray<T>, cmpFunc: (t: T) => boolean, startIndex?: number, ensure?: boolean): number; export declare const getCircularReplacer: () => (key: any, value: any) => any;