commit | 54884db790720ac0f7ca491cb9e6d7a0395ad4cb | [log] [tgz] |
---|---|---|
author | Devon Carew <devoncarew@google.com> | Fri Feb 23 09:07:09 2024 -0800 |
committer | GitHub <noreply@github.com> | Fri Feb 23 09:07:09 2024 -0800 |
tree | 712b63f6dee1cfa16b8d9cc7d532d750a90f05ef | |
parent | 82ab64d1217c08d93697aa414f214836eef52a4e [diff] |
update to the latest sdk; update lints (#68)
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
.