json_merge_patch 0.1.0 copy "json_merge_patch: ^0.1.0" to clipboard
json_merge_patch: ^0.1.0 copied to clipboard

RFC 7396 JSON Merge Patch implementation for Dart. Apply and generate JSON merge patches.

example/example.dart

// ignore_for_file: avoid_print
import 'package:json_merge_patch/json_merge_patch.dart';

void main() {
  // Apply a merge patch (RFC 7396)
  final target = {'a': 'b', 'c': {'d': 'e', 'f': 'g'}};
  final patch = {'a': 'z', 'c': {'f': null}};
  final result = mergePatch(target, patch);
  print(result); // {a: z, c: {d: e}}

  // Generate a merge patch from two JSON values
  final source = {'a': 'b', 'c': 'd'};
  final goal = {'a': 'z', 'e': 'f'};
  final generated = generate(source, goal);
  print(generated); // {a: z, c: null, e: f}
}
0
likes
160
points
10
downloads

Documentation

API reference

Publisher

verified publisherbrodykim.work

Weekly Downloads

RFC 7396 JSON Merge Patch implementation for Dart. Apply and generate JSON merge patches.

Repository (GitHub)
View/report issues

Topics

#json #patch #rfc7396 #merge-patch

License

MIT (license)

More

Packages that depend on json_merge_patch