isAtOrBelow

fun isAtOrBelow(prefix: String, candidate: String): Boolean(source)

True when prefix is at the same segment boundary as a prefix of candidate — i.e. either equals it or names an ancestor in the dotted-bracket tree.

Examples:

  • isAtOrBelow("scenarios[3]", "scenarios[3]") → true.

  • isAtOrBelow("scenarios[3]", "scenarios[3].runOverrides.x") → true.

  • isAtOrBelow("scenarios[3]", "scenarios[30].x") → false.

  • isAtOrBelow("scenarios", "scenarios[3].x") → true (whole subtree).

  • isAtOrBelow("", anything) → true (empty prefix matches all).