@yookue/ts-lang-utils
    Preparing search index...

    Function isJsonString

    • 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

      David Hsing

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