@bitblit/ratchet-common
Version:
Common tools for general use
16 lines (15 loc) • 973 B
TypeScript
import { KeyValue } from './key-value.js';
export declare class MapRatchet {
static expandNestedKeysToObjects<T>(src: any, separator?: string): T;
static mapByUniqueProperty<T, R>(input: T[], propName: string): Map<R, T>;
static groupByProperty<T, R>(input: T[], propName: string): Map<R, T[]>;
static findValue(toSearch: any, path: string[]): any;
static findValueDotPath(toSearch: any, dotPath: string): any;
static simpleDeepCompare(object1: any, object2: any): boolean;
static toKeyValueList(value: Record<string, any>): KeyValue<any>[];
static fromKeyValueList<T>(list: KeyValue<T>[]): Record<string, T>;
static cleanup<T>(obj: T, stripZero?: boolean, stripNull?: boolean, stripUndefined?: boolean, stripEmptyString?: boolean): T;
static extractValueFromMapIgnoreCase(src: any, key: string): any;
static safeCallFunction(ob: any, fnName: string): boolean;
static caseInsensitiveAccess<T>(ob: any, keyName: string): T;
}