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

Method matchesAt

src/parser/xref-parser.ts:513–523  ·  view source on GitHub ↗

* Check if bytes at position match a string.

(pos: number, str: string)

Source from the content-addressed store, hash-verified

511 * Check if bytes at position match a string.
512 */
513 private matchesAt(pos: number, str: string): boolean {
514 const bytes = this.scanner.bytes;
515
516 for (let i = 0; i < str.length; i++) {
517 if (pos + i >= bytes.length || bytes[pos + i] !== str.charCodeAt(i)) {
518 return false;
519 }
520 }
521
522 return true;
523 }
524
525 /**
526 * Skip whitespace at given position, return new position.

Callers 1

findStartXRefMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected