Function transformJson

  • Transforms and flattens a JSON object.

    Parameters

    • json: any

      The JSON object to be transformed.

    • options: TransformOptions = {}

      Options for the mutation functions.

    Returns [any, any]

    An array with the modified object and the flattened object.

    transformJson({ a: { b: 1 } }, { filter: 'a' });
    // => [{ a: { b: 1 } }, { a: { b: 1 } }]