(glyphs = [])
| 7 | * @return {Array} glyph indices |
| 8 | */ |
| 9 | const 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 | |
| 22 | export default resolve; |
no outgoing calls
no test coverage detected