default: {
    deepEqual: ((p1, p2, options?) => boolean);
    deepExtend: (<T>(...args) => Merge<T>);
    deepFlatten: ((obj, delimiter?) => Record<string, any>);
}

Type declaration

  • deepEqual: ((p1, p2, options?) => boolean)
      • (p1, p2, options?): boolean
      • Compares two objects and returns true if they have the same structure and values. Can work with arrays and objects, nested objects, recursive objects, dates, etc.

        Parameters

        • p1: any

          first object

        • p2: any

          second object

        • Optional options: {
              disregardArrayOrder?: boolean;
          }

          additional options

          • Optional disregardArrayOrder?: boolean

            if true, the order of the elements in the array will be disregarded e.g. [1, 2] and [2, 1] will be considered equal

        Returns boolean

        true if the objects are equal, false otherwise

  • deepExtend: (<T>(...args) => Merge<T>)
      • <T>(...args): Merge<T>
      • Type Parameters

        • T extends unknown[]

        Parameters

        • Rest ...args: T

        Returns Merge<T>

  • deepFlatten: ((obj, delimiter?) => Record<string, any>)
      • (obj, delimiter?): Record<string, any>
      • Flattens an object to a single level, with the nested keys separated by a delimiter.

        Parameters

        • obj: Record<string, any>
        • Optional delimiter: string = '.'

        Returns Record<string, any>

        Example

        deepFlatten({ a: { b: 1, c: 2 } });
        // => { 'a.b': 1, 'a.c': 2 }

        deepFlatten({ a: { b: 1, c: 2 } }, '/');
        // => { 'a/b': 1, 'a/c': 2 }

        deepFlatten({ a: { b: 1, c: { d: 'some val' } }, d: 3 });
        // => { 'a.b': 1, 'a.c.d': 'some val', d: 3 }

Generated using TypeDoc