Frodo Library - v4.0.0-10
    Preparing search index...

    Type Alias Json

    type Json = {
        cloneDeep(obj: any): any;
        deleteDeepByKey(object: any, substring: any): any;
        findInArray(objs: any[], predicate: any): any;
        get(obj: any, path: string[], defaultValue?: any): any;
        getPaths(o: any, prefix?: string, delim?: string): string[];
        isEqualJson(obj1: object, obj2: object, ignoreKeys?: string[]): boolean;
        mergeDeep(obj1: any, obj2: any): any;
        put(obj: any, value: any, path: string[]): any;
        stringify(obj: any): string;
    }
    Index

    Methods

    • Deep clone object

      Parameters

      • obj: any

        object to deep clone

      Returns any

      new object cloned from obj

    • Deep delete keys and their values from an input object. If a key in object contains substring, the key an its value is deleted.

      Parameters

      • object: any

        input object that needs keys removed

      • substring: any

        substring to search for in key

      Returns any

      the modified object without the matching keys and their values

    • Parameters

      • objs: any[]
      • predicate: any

      Returns any

    • Parameters

      • obj: any
      • path: string[]
      • OptionaldefaultValue: any

      Returns any

    • Get all paths for an object

      Parameters

      • o: any

        object

      • Optionalprefix: string

        prefix (path calculated up to this point). Only needed for recursion or to add a global prefix to all paths.

      • Optionaldelim: string

        delimiter used to separate elements of the path. Default is '.'.

      Returns string[]

      an array of paths

    • Compare two json objects

      Parameters

      • obj1: object

        object 1

      • obj2: object

        object 2

      • OptionalignoreKeys: string[]

        array of keys to ignore in comparison

      Returns boolean

      true if the two json objects have the same length and all the properties have the same value

    • Deep merge two objects

      Parameters

      • obj1: any

        first object

      • obj2: any

        second object

      Returns any

      merged first and second object

    • Parameters

      • obj: any
      • value: any
      • path: string[]

      Returns any

    • Deterministic stringify

      Parameters

      • obj: any

        json object to stringify deterministically

      Returns string

      stringified json object