yaml_edit library
YAML parsing is supported by package:yaml
, and each time a change is
made, the resulting YAML AST is compared against our expected output
with deep equality to ensure that the output conforms to our expectations.
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}
}
Classes
- SourceEdit
-
A class representing a change on a String, intended to be compatible with
package:analysis_server
's SourceEdit. - YamlEditor
- An interface for modifying YAML documents while preserving comments and whitespaces.
Functions
-
wrapAsYamlNode(
Object? value, {CollectionStyle collectionStyle = CollectionStyle.ANY, ScalarStyle scalarStyle = ScalarStyle.ANY}) → YamlNode -
Wraps
value
into aYamlNode
.
Exceptions / Errors
- AliasException
- Exception thrown when the path contains an alias along the way.