(word, width, font, fontSize)
| 2018 | }; |
| 2019 | // Break a long word into smaller parts character-by-character |
| 2020 | const forceBreakLongWord = (word, width, font, fontSize) => { |
| 2021 | const parts = []; |
| 2022 | let current = ""; |
| 2023 | |
| 2024 | for (const char of word) { |
| 2025 | const lineWidth = font.widthOfTextAtSize(current + char, fontSize); |
| 2026 | |
| 2027 | if (lineWidth <= width) { |
| 2028 | current += char; |
| 2029 | } else { |
| 2030 | parts.push(current); |
| 2031 | current = char; |
| 2032 | } |
| 2033 | } |
| 2034 | if (current) parts.push(current); |
| 2035 | |
| 2036 | return parts; |
| 2037 | }; |
| 2038 | |
| 2039 | export const isEmptyValue = (val) => |
| 2040 | val === null || |
no outgoing calls
no test coverage detected