MCPcopy Create free account
hub / github.com/LibPDF-js/core / compareKeys

Function compareKeys

src/document/name-tree.ts:45–55  ·  view source on GitHub ↗

* Compare two string keys for binary search. * Uses lexicographic comparison (same as PDF spec).

(a: string, b: string)

Source from the content-addressed store, hash-verified

43 * Uses lexicographic comparison (same as PDF spec).
44 */
45function compareKeys(a: string, b: string): number {
46 if (a < b) {
47 return -1;
48 }
49
50 if (a > b) {
51 return 1;
52 }
53
54 return 0;
55}
56
57/**
58 * PDF Name Tree reader.

Callers 2

getMethod · 0.85
buildNameTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected