kysely
    Preparing search index...

    Interface ParseJSONResultsPluginOptions

    interface ParseJSONResultsPluginOptions {
        objectStrategy?: ObjectStrategy;
        reviver?: (key: string, value: unknown, context?: any) => unknown;
        shouldParse?: (value: string, jsonPath: string) => boolean;
    }
    Index

    Properties

    objectStrategy?: ObjectStrategy

    When 'in-place', arrays' and objects' values are parsed in-place. This is the most time and space efficient option.

    This can result in runtime errors if some objects/arrays are readonly.

    When 'create', new arrays and objects are created to avoid such errors.

    Defaults to 'in-place'.

    reviver?: (key: string, value: unknown, context?: any) => unknown

    The reviver function that will be passed to JSON.parse. See The reviver parameter.

    shouldParse?: (value: string, jsonPath: string) => boolean

    A function that returns true if the given string is a JSON string that should be parsed. If a detected JSON string fails to parse, an error is thrown.

    Defaults to a function that checks if the string starts and ends with {} or [] - meaning anything that might be a JSON string, is attempted to be parsed - and if fails, proceeds.

    Type Declaration

      • (value: string, jsonPath: string): boolean
      • Parameters

        • value: string

          The string value to check.

        • jsonPath: string

          The JSON path leading to this value. e.g. $[0]."users"[0]."profile"

        Returns boolean

        true if the string should be JSON parsed.