@metreeca/qest - v0.9.2
    Preparing search index...

    Function decodePatch

    • Decodes a patch from a JSON string.

      If base is provided, resolves internal IRIs (matching isIRI(value, "internal")) to absolute IRIs using resolve(), recursively throughout the patch structure. Otherwise, performs plain JSON parsing.

      Parameters

      • json: string

        The JSON-serialized Patch

      • opts: CodecOpts = {}

        Decoding options

      Returns { readonly [property: string]: Values | Indexed<Values> | null }

      The decoded patch, with resolved IRIs if base is provided

      If json is not a string, not a valid Patch, or opts is not a valid CodecOpts

      decodePatch(
      '{"vendor":"/vendors/acme","description":null}',
      { base: "https://example.com/" }
      );
      // → { vendor: "https://example.com/vendors/acme", description: null }