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

Method matchesAt

src/parser/document-parser.ts:902–912  ·  view source on GitHub ↗

* Check if bytes at position match a pattern.

(pos: number, pattern: number[])

Source from the content-addressed store, hash-verified

900 * Check if bytes at position match a pattern.
901 */
902 private matchesAt(pos: number, pattern: number[]): boolean {
903 const bytes = this.scanner.bytes;
904
905 for (let i = 0; i < pattern.length; i++) {
906 if (pos + i >= bytes.length || bytes[pos + i] !== pattern[i]) {
907 return false;
908 }
909 }
910
911 return true;
912 }
913}

Callers 1

parseHeaderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected