MCPcopy
hub / github.com/diegomura/react-pdf / resolve

Function resolve

packages/textkit/src/indices/resolve.js:9–20  ·  view source on GitHub ↗
(glyphs = [])

Source from the content-addressed store, hash-verified

7 * @return {Array} glyph indices
8 */
9const resolve = (glyphs = []) => {
10 return glyphs.reduce((acc, glyph) => {
11 const codePoints = glyph?.codePoints || [DUMMY_CODEPOINT];
12
13 if (acc.length === 0) return codePoints.map(() => 0);
14
15 const last = acc[acc.length - 1];
16 const next = codePoints.map(() => last + 1);
17
18 return [...acc, ...next]
19 }, []);
20};
21
22export default resolve;

Callers 11

resolve.test.jsFile · 0.85
fetchLocalFileFunction · 0.85
resolveBase64ImageFunction · 0.85
resolveImageFromDataFunction · 0.85
resolveBufferImageFunction · 0.85
toBlobFunction · 0.85
toStringFunction · 0.85
renderToFileFunction · 0.85
renderToBufferFunction · 0.85
resolve.test.jsFile · 0.85
loadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected