lookup method

T? lookup(
  1. String path
)

Looks up the value stored at path, or null if none.

Implementation

T? lookup(String path) {
  final segments = _segments(path);
  var node = _root;
  for (final seg in segments) {
    final child = node.children[seg];
    if (child == null) return null;
    node = child;
  }
  return node.hasValue ? node.value : null;
}