(str, replaceInvisible = false)
| 199 | } |
| 200 | const InvisibleCharsRegExp = /[\x00-\x1F]/g; |
| 201 | function removeNullCharacters(str, replaceInvisible = false) { |
| 202 | if (!InvisibleCharsRegExp.test(str)) { |
| 203 | return str; |
| 204 | } |
| 205 | if (replaceInvisible) { |
| 206 | return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " "); |
| 207 | } |
| 208 | return str.replaceAll("\x00", ""); |
| 209 | } |
| 210 | function binarySearchFirstItem(items, condition, start = 0) { |
| 211 | let minIndex = start; |
| 212 | let maxIndex = items.length - 1; |
no test coverage detected