v3.0.0
json_patch
純 Dart 工具套件,用於 JSON Patch 標準。可套用補丁作業,亦可對類似 JSON 的物件執行差異演算法。
25喜歡 8700近 30 天下載140Pub 分數
AndroidiOSWebmacOSWindowsLinux
用於 JSON Patch 標準的純 Dart 工具套件。
^1.15.0^1.17.5以下為英文專案原文快照,最新內容請造訪 GitHub。
A simple utility package for JSON Patch. Includes a simple diff algorithm as well as the ability to apply JSON Patch operations to a JSON-like Dart object.
import 'package:json_patch/json_patch.dart';
...
final ops = JsonPatch.diff(oldJson, newJson);
try {
final patchedJson = JsonPatch.apply(json, patches, strict: false);
} on JsonPatchTestFailedException catch (e) {
print(e);
}
See the example or the API docs for more information.