valuePathToRootWith method

List<T> valuePathToRootWith({
  1. Iterable<T>? head,
  2. Iterable<T>? tail,
})

Same as valuePathToRoot, but with additional head and tail.

Implementation

List<T> valuePathToRootWith({Iterable<T>? head, Iterable<T>? tail}) {
  final valuePathToRoot = this.valuePathToRoot;

  if (head != null || tail != null) {
    return [...?head, ...valuePathToRoot, ...?tail];
  } else {
    return valuePathToRoot;
  }
}