(text: string)
| 147 | |
| 148 | /** Encodes into `scratchUtf8`, returning how many bytes it holds, or -1. */ |
| 149 | const encodeUtf8Scratch = (text: string): number => { |
| 150 | const capacity = text.length * 3 |
| 151 | if (capacity > scratchUtf8Limit) return -1 |
| 152 | if (capacity > scratchUtf8.length) scratchUtf8 = new Uint8Array(capacity) |
| 153 | return textEncoder.encodeInto(text, scratchUtf8).written |
| 154 | } |
| 155 | |
| 156 | const encodeUtf8 = (text: string): Uint8Array => { |
| 157 | const length = text.length |
no outgoing calls
no test coverage detected