commit | 48e5868b307b2a3619fc9aaf3e70c0c637c91b7e | [log] [tgz] |
---|---|---|
author | Kevin Moore <kevmoo@users.noreply.github.com> | Wed Mar 08 01:44:06 2023 -0800 |
committer | GitHub <noreply@github.com> | Wed Mar 08 10:44:06 2023 +0100 |
tree | e137ef60b76219282b56ae215464e503ec10c7ec | |
parent | aaa1d53590d4ae3b70b2529bfec533df7c0abd9b [diff] |
blast_repo fixes (#46) auto-publish github-actions no-response
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
.