import deepCopy from 'rfdc'; import deepMerge from 'deepmerge'; import { JsonValue } from '../types'; /** * Validate a possible JSON object represented as string */ export declare function isJSONObjectString(s: string): boolean; /** * Validate a possible JSON object represented as string */ export declare function isJSONObject(o: any): boolean; export declare function isValidJSON(v: any): v is JsonValue; /** * Cast a value to a type (bypasses similarity check) * @param value - Pass value to cast or leave empty to create an empty type-only placeholder */ export declare const cast: (value?: any) => T; /** * Swap key & value in a map */ export declare const reverseMap: (map: Map) => Map; /** * forEach with accumulator. This is meant to replace difficult to read Array.reduce methods. */ export declare function accForEach(arr: T[], acc: Acc, cb: (item: T, acc: Acc, index: number, arr: T[]) => void): Acc; /** * forEach with accumulator. This is meant to replace difficult to read Array.reduce methods. */ export declare function accForEach(iterable: Iterable, acc: Acc, cb: (item: T, acc: Acc, index: number, iterable: Iterable) => void): Acc; /** * Executes fn, swallowing error (saves performance by not generating a stack) */ export declare function swallowError any, ErrRetVal = undefined>(fn: Fn, errorReturnValue?: ErrRetVal): ReturnType | ErrRetVal; /** * If value is truthy, returns `value` (or `v` if no `value` provided), otherwise, returns an empty string * @param v - Var to check for truthiness * @param value - Value to return if true */ export declare function truthyStr(v: any, value?: string): string; /** * Join paths with forward separator (ignores falsy) & normalizes (all backslashes to forward slash, no running slashes) */ export declare function normalizeAndJoinPaths(...paths: (string | undefined)[]): string; export { deepMerge, deepCopy };