• Returns whether the given string is a JSON string

    Parameters

    • Optionaltext: null | string

      the string to check

    Returns boolean

    whether the given object is a JSON string

    isJsonString(`{"foo": "bar"}`);    // true
    isJsonString(`[{"foo": "bar"}]`); // true
    isJsonString(`[{"foo": "bar"}, {"hello": "world"}]`); // true