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

Method peekKeyword

src/parser/xref-parser.ts:607–617  ·  view source on GitHub ↗

* Check if current position starts with a keyword (without consuming).

(keyword: string)

Source from the content-addressed store, hash-verified

605 * Check if current position starts with a keyword (without consuming).
606 */
607 private peekKeyword(keyword: string): boolean {
608 const startPos = this.scanner.position;
609
610 for (let i = 0; i < keyword.length; i++) {
611 if (this.scanner.peekAt(startPos + i) !== keyword.charCodeAt(i)) {
612 return false;
613 }
614 }
615
616 return true;
617 }
618}

Callers 1

parseTableMethod · 0.95

Calls 1

peekAtMethod · 0.80

Tested by

no test coverage detected