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

Function parser

src/parser/indirect-object-parser.test.ts:16–25  ·  view source on GitHub ↗

* Helper to create an IndirectObjectParser from a string.

(
  input: string,
  lengthResolver?: (ref: PdfRef) => number | null,
  options?: IndirectObjectParserOptions,
)

Source from the content-addressed store, hash-verified

14 * Helper to create an IndirectObjectParser from a string.
15 */
16function parser(
17 input: string,
18 lengthResolver?: (ref: PdfRef) => number | null,
19 options?: IndirectObjectParserOptions,
20): IndirectObjectParser {
21 const bytes = new TextEncoder().encode(input);
22 const scanner = new Scanner(bytes);
23
24 return new IndirectObjectParser(scanner, lengthResolver, options);
25}
26
27describe("IndirectObjectParser", () => {
28 describe("standard objects", () => {

Callers 1

Calls 1

encodeMethod · 0.65

Tested by

no test coverage detected