igpapi — Instagram private API Simulator for Node.js (API reference) 4.14.0
    Preparing search index...

    Function fromJsonText

    • Schema.fromJsonString over the core's one JSON reader: the text is read in the response mode (a number literal of more than 15 characters arrives as its exact text, a number under an id key as its text), then decoded by schema; encoding writes the value as JSON text. A schema that decodes a JSON string field — a GraphQL answer's body, a document an answer embeds — uses this, never Schema.fromJsonString, whose JSON.parse rounds a long id. The code outside the core reads an embedded JSON text only through it, so the parse stays in the core. repair, when given, rewrites the text before it is read (Bloks embeds slightly malformed JSON; Bloks.fromRepairedJsonText passes its repair).

      Type Parameters

      • S extends Constraint

      Parameters

      • schema: S
      • options: { repair?: (text: string) => string } = {}

      Returns decodeTo<S, String>