Lattyware / elm-json-diff

Compute JSON patches by comparing two JSON values.

Home Page:https://package.elm-lang.org/packages/lattyware/elm-json-diff/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elm-json-diff

Elm package GitHub GitHub Workflow Status

Compute JSON patches by comparing two JSON values.

Usage

patch =
    Json.Diff.diff oldDocument newDocument

Creating a patch has to be done on the Value type, due to the type system (records can't be accessed by field name in Elm).

However, if you have an encoder for your Elm type, you can create a patch by encoding the data first.

About

Compute JSON patches by comparing two JSON values.

https://package.elm-lang.org/packages/lattyware/elm-json-diff/latest/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Elm 100.0%