README.md

common-ych

Common tools for data transformation

API:

// commonych/ArrayFn
export class ArrayFn
{
    public static chunkArray<T>(array: T[], chunkSize: number): T[][];

    public static fillKeys<K extends (number|string|symbol), T>(
        keys: K[], 
        val: T
    ): {[P in K]: T};

    public static groupBy<
        K extends string|number|symbol,
        T extends {[Key in K]: string|symbol|number}
    >(k: K, ts: T[]): {[Key in T[K]]: T[]};

    public static unique<T>(
        arr: T[], 
        includesCheck: ((acc:T[], b:T) => boolean)|null = null
    ): T[];
}
// commonych/BigIntFn
export class BigIntFn
{
    public static abs(v: bigint): bigint ;

    public static sign(v: bigint): bigint ;

    public static toNumber(v: bigint): number ;

    public static max(v0: bigint, ...v: bigint[]): bigint ;

    public static min(v0: bigint, ...v: bigint[]): bigint ;
}
//commonych SerializeFn
export class SerializeFn
{
    public static normalize(
        a: any, 
        context: any[] = []
    ): object|boolean|number|string|null|any[];

    public static serialize(any : any): string;
}

Author

Anatoly Starodubtsev tostar74@mail.ru

License

MIT

Описание
Typical common tools for TS data transformations
Конвейеры
0 успешных
0 с ошибкой
Разработчики