prependToList method

void prependToList(
  1. Iterable<Object?> path,
  2. Object? value
)

Prepends value to the list at path.

Throws a ArgumentError if the element at the given path is not a YamlList or if the path is invalid.

Throws an AliasException if a node on path is an alias or anchor.

Example:

final doc = YamlEditor('[1, 2]');
doc.prependToList([], 0); // [0, 1, 2]

Implementation

void prependToList(Iterable<Object?> path, Object? value) {
  insertIntoList(path, 0, value);
}