MCPcopy
hub / github.com/vercel/next.js / checkMissingConditions

Function checkMissingConditions

packages/next-routing/src/matchers.ts:120–140  ·  view source on GitHub ↗
(
  missing: RouteHas[] | undefined,
  url: URL,
  headers: Headers
)

Source from the content-addressed store, hash-verified

118 * Checks if all "missing" conditions are satisfied (i.e., none of them match)
119 */
120export function checkMissingConditions(
121 missing: RouteHas[] | undefined,
122 url: URL,
123 headers: Headers
124): boolean {
125 if (!missing || missing.length === 0) {
126 return true
127 }
128
129 for (const condition of missing) {
130 const actualValue = getConditionValue(condition, url, headers)
131 const result = matchesCondition(actualValue, condition.value)
132
133 // If any missing condition matches, the check fails
134 if (result.matched) {
135 return false
136 }
137 }
138
139 return true
140}

Callers 3

matchRouteFunction · 0.90
checkDynamicRoutesFunction · 0.90
resolveRoutesFunction · 0.90

Calls 2

getConditionValueFunction · 0.85
matchesConditionFunction · 0.85

Tested by

no test coverage detected