UNPKG

pddl-workspace

Version:
37 lines (36 loc) 1.73 kB
export declare class Util { /** * Wraps path with doublequotes, if it includes a space. * * This is necessary on Windows in order to handle spaces in file and directory names. * @param path file system path */ static q(path: string): string; static shouldBeDoubleQuoted(path: string): boolean; /** * Replaces all occurrences * @param text text to replace in * @param searchValue value to replace * @param replaceValue replacement value */ static replaceAll(text: string, searchValue: string, replaceValue: string): string; /** * Groups array by a key * @param list list to be grouped * @param keyGetter grouping key selector */ static groupBy<K, V>(list: Array<V>, keyGetter: (value: V) => K): Map<K, V[]>; /** * Equivalent of flatMap from other languages. * @param arrayOfArrays array of arrays to be flattened to single dimentional array */ static flatMap<T>(arrayOfArrays: Array<Array<T>>): Array<T>; static distinct<T>(array: Array<T>): Array<T>; } /** @returns `true` if `text1` and `text2` are equal ignoring case. */ export declare function equalsCaseInsensitive(text1: string, text2: string): boolean; export declare function addToMapOfSets<K, V>(multiMap: Map<K, Set<V>>, key: K, value: V): void; export declare function removeFromMapOfSets<K, V>(multiMap: Map<K, Set<V>>, key: K, value: V): boolean; export declare function addToMapOfLists<K, V>(multiMap: Map<K, V[]>, key: K, value: V): void; export declare function addAllToMapOfLists<K, V>(multiMap: Map<K, V[]>, key: K, values: V[]): void; export declare function split<T>(collection: T[], predicate: (element: T) => boolean): [T[], T[]];