Sign in

    jsondiff

    Download zip
    Version
    0.1.3
    License
    Apache-2.0
    Last updated
    10 days ago
    Downloads
    59

    No dependencies

    #jsondiff

    Simple Json Structrual Diff Library

    ///|
    test {
    let old : Json = { "foo": [1, 2, 3], "bar": { "baz": "qux" } }
    let new : Json = {
    "foo": [1, 2, 4],
    "bar": { "baz": "quux" },
    "new_key": true,
    }
    inspect(
    @jsondiff.JsonDiff::diff_string(old, new).unwrap(),
    content=(
    #| {
    #|+ new_key: true
    #| foo: [
    #| 1
    #| 2
    #|- 3
    #|+ 4
    #| ]
    #| bar: {
    #|- baz: "qux"
    #|+ baz: "quux"
    #| }
    #| }
    ),
    )
    }

    JsonArrayEdit

    type JsonArrayEdit derive(Eq,
    Debug
    )

    JsonArrayEdit::equal

    #deprecated("`JsonArrayEdit` is internal to jsondiff")
    fn JsonArrayEdit::equal(JsonArrayEdit, JsonArrayEdit) -> Bool

    JsonArrayEdit::not_equal

    #deprecated("`JsonArrayEdit` is internal to jsondiff")
    fn JsonArrayEdit::not_equal(x : JsonArrayEdit, y : JsonArrayEdit) -> Bool

    JsonArrayEdit::to_repr

    #deprecated("`JsonArrayEdit` is internal to jsondiff")
    fn JsonArrayEdit::to_repr(JsonArrayEdit) ->
    Repr

    JsonDiff

    type JsonDiff

    Auxiliary structure to encapsulate data about the structural difference of two JSON files.

    JsonDiff::diff

    fn JsonDiff::diff(lhs : Json, rhs : Json, keys_only? : Bool) -> JsonDiff

    Finds the JSON structural difference of two JSON files.

    JsonDiff::diff_string

    fn JsonDiff::diff_string(lhs : Json, rhs : Json, keys_only? : Bool, terminal? : Bool) -> String?

    Finds the JSON structural difference of two JSON files and returns it as a formatted string.

    JsonEdit

    type JsonEdit derive(Eq,
    Debug
    )

    JsonEdit::equal

    #deprecated("`JsonEdit` is internal to jsondiff")
    fn JsonEdit::equal(JsonEdit, JsonEdit) -> Bool

    JsonEdit::not_equal

    #deprecated("`JsonEdit` is internal to jsondiff")
    fn JsonEdit::not_equal(x : JsonEdit, y : JsonEdit) -> Bool

    JsonEdit::to_repr

    #deprecated("`JsonEdit` is internal to jsondiff")
    fn JsonEdit::to_repr(JsonEdit) ->
    Repr

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io