declare method

List<int> declare(
  1. List<String> layerPath
)

Ensures layerPath exists and returns its stable sort key.

Implementation

List<int> declare(List<String> layerPath) {
  var node = _root;
  final key = <int>[];
  for (final seg in layerPath) {
    final child = seg == kWebFImplicitLayerSegment
        ? node.ensureImplicitChild()
        : node.ensureChild(seg);
    key.add(child.siblingIndex);
    node = child;
  }
  return key;
}