* Lazily retrieves the Unicode code point representation. * @return {number[]} Array of Unicode code points
()
| 67 | * @return {number[]} Array of Unicode code points |
| 68 | */ |
| 69 | getCodePoints () { |
| 70 | if (this._codePoints === null) { |
| 71 | if (this._string !== null) { |
| 72 | // retrieve code points from string |
| 73 | this._codePoints = TextEncoder.codePointsFromString(this._string) |
| 74 | } else { |
| 75 | // retrieve code points from bytes |
| 76 | this._codePoints = TextEncoder.codePointsFromBytes( |
| 77 | this._bytes, this._encoding) |
| 78 | } |
| 79 | } |
| 80 | return this._codePoints |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Returns a string for each Unicode character. |
no test coverage detected