Core - v1.3.2
    Preparing search index...

    Class Json

    Parses untrusted JSON without throwing on invalid syntax.

    Parsing does not validate the result's shape. Callers must check the fields they need, even when they supply a type argument.

    const input = Json.parse<{ symbol?: string }>(await request.text())

    if (!input) {
    return fail('Body must be valid JSON')
    }

    Bayu Dwiyan Satria

    1.0.0

    1.3.0

    Index
    • Parses JSON, returning null for empty input, invalid syntax, or a null literal.

      Type Parameters

      • T = unknown

        The expected shape, which is not validated.

      Parameters

      • text: string

        The raw text to parse.

      Returns T

      The parsed value, including valid primitives, or null.