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

Method at

src/objects/pdf-array.ts:48–56  ·  view source on GitHub ↗

* Get item at index. Returns undefined if out of bounds. * If resolver is provided, resolves indirect references.

(index: number, resolver?: RefResolver)

Source from the content-addressed store, hash-verified

46 * If resolver is provided, resolves indirect references.
47 */
48 at(index: number, resolver?: RefResolver): PdfObject | undefined {
49 const value = this.items.at(index);
50
51 if (resolver && value?.type === "ref") {
52 return resolver(value) ?? undefined;
53 }
54
55 return value;
56 }
57
58 /**
59 * Set item at index. Extends array if needed.

Callers 15

drawing.test.tsFile · 0.80
pdf-array.test.tsFile · 0.80
parseStreamMethod · 0.80
walkNodeMethod · 0.80
getFileIdMethod · 0.80
getLayersFunction · 0.80

Calls 1

resolverFunction · 0.50

Tested by

no test coverage detected