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

    Function encodePatch

    • Encodes a patch as a JSON string.

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

      Parameters

      Returns string

      The JSON string, with internalized IRIs if base is provided

      If patch is not a valid Patch or opts is not a valid CodecOpts

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