json_delta_tool

Last updated:

0 purchases

json_delta_tool Image
json_delta_tool Images
Add to Cart

Description:

json delta tool

A simple tool for calculating the delta (difference) between 2 json objects with the same schema.
Particulary useful for editing objects in UI - enabling save button if the edited object differs from the original, and sending a PATCH request to the backend using the delta method.
Features #
This tool includes 2 basic functionalities:

Check if 2 json objects differ
Subtract 2 json objects and get a json object with the difference.

Getting started #
flutter pub install json_delta
Usage #
Map<String, dynamic> person = {
'name': 'John Doe',
'age': 30,
'email': '[email protected]'
};

Map<String, dynamic> editedPerson = {
'name': 'John Doe',
'age': 30,
'email': '[email protected]'
};

// Output: true
print(JsonDelta.hasDelta(person, editedPerson));

// Output: {'email': '[email protected]'}
print(JsonDelta.delta(person, editedPerson));
copied to clipboard
Additional information #
This tool is intended for work with objects of the same schema.
For more detailed use cases see the examples.
Feel free to open issues in the GitHub repository.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.