Skip to content

ui-router-server / matcher / compare

Function: compare()

ts
function compare(a, b): number;

Defined in: url-matcher.ts:516

Sorts two compiled matchers by static specificity, as core's UrlMatcher.compare: path tokens compared position-by-position, slash before static text before a param. Negative means a is more specific than b. Single-matcher only: matchers here never append.

Parameters

ParameterType
aCompiledMatcher<unknown>
bCompiledMatcher<unknown>

Returns

number