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

Method skipInvalidPair

src/parser/object-parser.ts:373–390  ·  view source on GitHub ↗

* Skip an invalid key-value pair in recovery mode. * Consumes the current (invalid) token and the next token (its would-be value).

()

Source from the content-addressed store, hash-verified

371 * Consumes the current (invalid) token and the next token (its would-be value).
372 */
373 private skipInvalidPair(): void {
374 // Skip the invalid key
375 this.shift();
376
377 this.ensureBufferFilled();
378
379 // Check if we hit end or dict close
380 if (this.buf1 === null || this.buf1.type === "eof") {
381 return;
382 }
383
384 if (this.buf1.type === "delimiter" && this.buf1.value === ">>") {
385 return;
386 }
387
388 // Skip the would-be value
389 this.shift();
390 }
391}

Callers 1

parseDictMethod · 0.95

Calls 2

shiftMethod · 0.95
ensureBufferFilledMethod · 0.95

Tested by

no test coverage detected