pub repository
mirror.p-hatan.comyaml_edit
1.0.2A library for YAML manipulation with comment and whitespace preservation.
Readme
Yaml Editor
A library for YAML manipulation while preserving comments.
Disclaimer: This is not an officially supported Google product.
Usage
A simple usage example:
import 'package:yaml_edit/yaml_edit.dart';
void main() {
final yamlEditor = YamlEditor('{YAML: YAML}');
yamlEditor.assign(['YAML'], "YAML Ain't Markup Language");
print(yamlEditor);
// Expected output:
// {YAML: YAML Ain't Markup Language}
}
Testing
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.
Limitations
- Users are not allowed to define tags in the modifications.
- Map keys will always be added in the flow style.
Changelog
v1.0.2
- Throws an error if the final YAML after edit is not parsable.
- Fixed bug in adding to empty map values, when it is followed by other content.
v1.0.1
- Updated behavior surrounding list and map removal.
- Fixed bug in dealing with empty values.
v1.0.0
- Initial release.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add yaml_editpubspec.yaml
name: yaml_edit
version: 1.0.2
description: A library for YAML manipulation with comment and whitespace preservation.
homepage: https://github.com/google/dart-neats/tree/master/yaml_edit
repository: https://github.com/google/dart-neats.git
issue_tracker: https://github.com/google/dart-neats/labels/pkg:yaml_edit
dependencies:
meta: ^1.1.8
yaml: ^2.2.1
source_span: ^1.7.0
collection: ^1.14.11
dev_dependencies:
pedantic: ^1.9.0
test: ^1.14.4
path: ^1.6.2
environment:
sdk: ">=2.4.0 <3.0.0"
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 1.0.0 | 2020-08-07T19:37:14.080145Z | Download | 7aded93a7902a8e393c3fd460a1ddab581e4d48f846721021564339aff6f9813 |
| 1.0.1 | 2020-08-25T13:05:50.554054Z | Download | 4d962e6e7734966800e4f51e59c8a0870f7742b6c58c7293805cd16c9685d39f |
| 1.0.2 | 2020-09-01T07:47:08.546240Z | Download | b48347839593c0f4d5d9ceaa9f4283ead38b4e62a9d88bcc68feb4f81bcfc013 |
| 1.0.3 | 2020-11-02T13:14:30.871551Z | Download | 384dba0fd40414893814b15c716a63e154c208d85d1501cee73b003520cc189f |
| 2.0.0 | 2021-04-28T10:44:04.976225Z | Download | 9cffdaf877d5cedfd2d1b12d060bd8dc8a8987af3817f2c1bfbafb7c5b5f5cfe |
| 2.0.1 | 2021-09-27T10:51:34.715543Z | Download | fe1124241eb38f41246dced57c847240ea63a02d42c7eae40cbb6dd05265d22f |
| 2.0.2 | 2022-03-17T11:36:22.146801Z | Download | 2caa94e8c10f2d15dace3d6c100aec8dc44865da068b9a1ad259fa88e24147bb |
| 2.0.3 | 2022-05-12T16:14:13.068110Z | Download | 4240d1b19841b8af5786121e4e357735cc2a8ffb19176bff5769d73c34e2a8a5 |
| 2.1.0 | 2023-03-02T11:41:29.108154Z | Download | 0b968021754d8fbd3e9c83563b538ee417d88b2cc587606da5615546b7ee033b |
| 2.1.1 | 2023-05-02T12:04:10.475895Z | Download | 1579d4a0340a83cf9e4d580ea51a16329c916973bffd5bd4b45e911b25d46bfd |
| 2.2.0 | 2024-02-21T16:32:24.965116Z | Download | c566f4f804215d84a7a2c377667f546c6033d5b34b4f9e60dfb09d17c4e97826 |
| 2.2.1 | 2024-05-02T13:43:43.549522Z | Download | e9c1a3543d2da0db3e90270dbb1e4eebc985ee5e3ffe468d83224472b2194a5f |
| 2.2.2 | 2024-12-20T13:48:08.944899Z | Download | fb38626579fb345ad00e674e2af3a5c9b0cc4b9bfb8fd7f7ff322c7c9e62aef5 |
| 2.2.3 | 2025-12-02T08:48:07.674594Z | Download | ec709065bb2c911b336853b67f3732dd13e0336bd065cc2f1061d7610ddf45e3 |
| 2.2.4 | 2026-02-13T07:12:23.296061Z | Download | 07c9e63ba42519745182b88ca12264a7ba2484d8239958778dfe4d44fe760488 |
Dependencies
collection "^1.14.11"
meta "^1.1.8"
source_span "^1.7.0"
yaml "^2.2.1"