• Converts a JavaScript Object Notation B (JSONB) string into an object.

    Parameters

    • text: string

      A valid JSON string.

    • Optionalreviver: (this: any, key: string, value: any) => any

      A function that transforms the results. This function is called for each member of the object.

    • Optionaloptions: {
          bigint?: boolean;
          class?: false;
          function?: false;
          get?: false;
          Infinity?: boolean;
          NaN?: boolean;
          NegativeInfinity?: boolean;
          set?: false;
          undefined?: boolean;
      }

      The options for parsing the JSON string.

      • Optionalbigint?: boolean

        A value that indicates whether to parse bigints (ex. 57126n).

      • Optionalclass?: false

        A value that indicates whether to parse classes (ex. class).

        Warning: This option is currently ignored as it is non-functional.

      • Optionalfunction?: false

        A value that indicates whether to parse functions (ex. function).

        Warning: This option is currently ignored as it is non-functional.

      • Optionalget?: false

        A value that indicates whether to parse getter functions (ex. get).

        Warning: This option is currently ignored as it is non-functional.

      • OptionalInfinity?: boolean

        A value that indicates whether to parse Infinity (ex. Infinity).

      • OptionalNaN?: boolean

        A value that indicates whether to parse NaN (ex. NaN).

      • OptionalNegativeInfinity?: boolean

        A value that indicates whether to parse -Infinity (ex. -Infinity).

      • Optionalset?: false

        A value that indicates whether to parse setter functions (ex. set).

        Warning: This option is currently ignored as it is non-functional.

      • Optionalundefined?: boolean

        A value that indicates whether to parse undefined (ex. undefined).

    Returns any

    A JavaScript value, usually an object or array, that represents the JSONB that was parsed from the specified string.