compareGlobPathMatches
compareGlobPathMatches(
left,right):number
Defined in: packages/format-glob/src/compile-glob-path.ts:208
Which of two matching patterns is the more specific, most specific first.
An exact strict weak ordering — no tolerance and no “close enough” tier — so it is safe to sort, bisect or heap with. The ranking every configuration overlay ends up needing:
- By kind: exact text, then in-segment globs, then
*, then**, then any mixture of those, which is the least specific thing a pattern can be; - Between two patterns holding a single
*and nothing else, the one whose*is rightmost — a trailing wildcard constrains more of the path; - Fewer special segments;
- More segments, since each one is another constraint;
- Fewer
**.
Two patterns that tie on all five are genuinely equivalent for precedence, and the caller’s own order decides between them.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number