Genkit JS API reference
    Preparing search index...

    Function diff

    • Computes an RFC 6902 JSON Patch that transforms from into to.

      The diff is rooted at the document, so pointers are bare (e.g. /agentStatus, /items/0). Only add / remove / replace operations are emitted.

      When the two documents differ at the root in a way that cannot be expressed as member-level changes (e.g. an object becomes an array, or a primitive changes), a single whole-document replace at path "" is returned.

      Parameters

      • from: unknown
      • to: unknown

      Returns JsonPatch