MCPcopy Create free account
hub / github.com/KaTeX/KaTeX / typeFirstCompare

Function typeFirstCompare

test/setup.ts:11–19  ·  view source on GitHub ↗
(a: {key: string}, b: {key: string})

Source from the content-addressed store, hash-verified

9// JSON serializer
10
11const typeFirstCompare = (a: {key: string}, b: {key: string}) => {
12 if (a.key === 'type') {
13 return -1;
14 } else if (b.key === 'type') {
15 return 1;
16 } else {
17 return a.key < b.key ? -1 : 1;
18 }
19};
20
21const replacer = (key: string, value: unknown) => {
22 if (value instanceof Lexer) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected