Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanity-io/mendoza
Differ for structured documents (JSON)
https://github.com/sanity-io/mendoza
Last synced: 7 days ago
JSON representation
Differ for structured documents (JSON)
- Host: GitHub
- URL: https://github.com/sanity-io/mendoza
- Owner: sanity-io
- License: mit
- Created: 2020-01-20T15:27:33.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-09T11:30:56.000Z (2 months ago)
- Last Synced: 2024-09-09T13:46:38.751Z (2 months ago)
- Language: Go
- Homepage:
- Size: 71.3 KB
- Stars: 253
- Watchers: 26
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - mendoza - io | 209 | (Go)
README
# Mendoza, differ for structured documents
Mendoza looks at two structured documents, referred to as _left_ and _right_, and constructs a _patch_ of the differences.
By having the left document and the patch you'll be able to recover the right document.
Mendoza is designed for creating a _minimal_ patch, not necessarily a _readable_ patch.Example:
```
$ cat left.json
{"name": "Bob Bobson", "age": 30, "skills": ["Go", "Patching", "Playing"]}
$ cat right.json
{"firstName": "Bob Bobson", "age": 30, "skills": ["Diffing", "Go", "Patching"]}
$ dozadiff left.json right.json
[19,1,10,1,14,"firstName",11,2,20,"Diffing",21,0,2,15]
```**Features / non-features:**
- Lightweight JSON format.
- Flexible format which can accommodate more advanced encodings in the future.
- Differ/patcher available as a Go library (this repo).
- Patcher available as a JavaScript library: [mendoza-js](https://github.com/sanity-io/mendoza-js).
- Efficient handling of renaming of fields.
- Efficient handling of reordering of arrays.
- Not designed to be human readable.
- The patch can only be applied against the exact same version.**Format**: See [docs/format.adoc](docs/format.adoc)