MCPcopy Index your code
hub / github.com/diegomura/react-pdf / toString

Method toString

packages/pdfkit/src/name_tree.js:20–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 }
19
20 toString() {
21 // Needs to be sorted by key
22 const sortedKeys = Object.keys(this._items).sort((a, b) =>
23 a.localeCompare(b),
24 );
25
26 const out = ['<<'];
27 if (sortedKeys.length > 1) {
28 const first = sortedKeys[0],
29 last = sortedKeys[sortedKeys.length - 1];
30 out.push(
31 ` /Limits ${PDFObject.convert([new String(first), new String(last)])}`,
32 );
33 }
34 out.push(' /Names [');
35 for (let key of sortedKeys) {
36 out.push(
37 ` ${PDFObject.convert(new String(key))} ${PDFObject.convert(
38 this._items[key],
39 )}`,
40 );
41 }
42 out.push(']');
43 out.push('>>');
44 return out.join('\n');
45 }
46}
47
48export default PDFNameTree;

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
convertMethod · 0.80

Tested by

no test coverage detected