commit | e05282bcc1deac86a49e1a2932bc51dff52d5018 | [log] [tgz] |
---|---|---|
author | Jonas Finnemann Jensen <jonasfj@google.com> | Tue May 02 14:01:26 2023 +0200 |
committer | GitHub <noreply@github.com> | Tue May 02 14:01:26 2023 +0200 |
tree | 0456b462d9fdfd4c8aeb56f354b8d49d67fb8810 | |
parent | 5f392a1511ab97dde0e4a6bb7225f283f59ea840 [diff] |
Prepare 2.1.1 release (#52)
A library for YAML manipulation while preserving comments.
A simple usage example:
import 'package:yaml_edit/yaml_edit.dart'; void main() { final yamlEditor = YamlEditor('{YAML: YAML}'); yamlEditor.update(['YAML'], "YAML Ain't Markup Language"); print(yamlEditor); // Expected output: // {YAML: YAML Ain't Markup Language} }
void main() { final jsonString = r''' { "key": "value", "list": [ "first", "second", "last entry in the list" ], "map": { "multiline": "this is a fairly long string with\nline breaks..." } } '''; final jsonValue = json.decode(jsonString); // Convert jsonValue to YAML final yamlEditor = YamlEditor(''); yamlEditor.update([], jsonValue); print(yamlEditor.toString()); }
Testing is done in two strategies: Unit testing (/test/editor_test.dart
) and Golden testing (/test/golden_test.dart
). More information on Golden testing and the input/output format can be found at /test/testdata/README.md
.
These tests are automatically run with pub run test
.