MCPcopy Create free account
hub / github.com/arktypeio/arktype / compareInnerKeys

Function compareInnerKeys

ark/schema/parse.ts:243–249  ·  view source on GitHub ↗
(l: string, r: string)

Source from the content-addressed store, hash-verified

241
242// children after other values, in order of precedence
243export const compareInnerKeys = (l: string, r: string): number =>
244 isNodeKind(l) ?
245 isNodeKind(r) ? precedenceOfKind(l) - precedenceOfKind(r)
246 : 1
247 : isNodeKind(r) ? -1
248 : l < r ? -1
249 : 1
250
251// a label names a value in its messages, which an empty one can't: written
252// before "must be", it would leave the message starting with a space and a

Callers 1

parseNodeFunction · 0.85

Calls 2

isNodeKindFunction · 0.90
precedenceOfKindFunction · 0.90

Tested by

no test coverage detected