Function getJsonIndentation

  • This function calculates the indentation level of a JSON string.

    Parameters

    • json: string

      The JSON string whose indentation level is to be calculated.

    Returns number

    The number of leading spaces on the second line of the JSON string, or 0 if the JSON string has less than two lines or if the second line does not start with any spaces.

Generated using TypeDoc