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.