Skip to content

Commit b351f2a

Browse files
committed
fix bmp checking
1 parent 0800ab2 commit b351f2a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Since [Hermes doesn't support the `Intl.Segmenter` API](https://github.com/faceb
220220

221221
| Name | Unicode® | ESM? | Size | Size (min) | Size (min+gzip) | Size (min+br) | Size (min+zstd) |
222222
|------------------------------|----------|------|----------:|-----------:|----------------:|--------------:|----------------:|
223-
| `unicode-segmenter/grapheme` | 16.0.0 | ✔️ | 15,586 | 12,166 | 5,037 | 3,717 | 4,726 |
223+
| `unicode-segmenter/grapheme` | 16.0.0 | ✔️ | 15,588 | 12,168 | 5,038 | 3,715 | 4,727 |
224224
| `graphemer` | 15.0.0 | ✖️ ️| 410,435 | 95,104 | 15,752 | 10,660 | 15,911 |
225225
| `grapheme-splitter` | 10.0.0 | ✖️ | 122,252 | 23,680 | 7,852 | 4,841 | 6,750 |
226226
| `@formatjs/intl-segmenter`* | 15.0.0 | ✖️ | 603,285 | 369,560 | 72,218 | 49,416 | 67,975 |
@@ -236,7 +236,7 @@ Since [Hermes doesn't support the `Intl.Segmenter` API](https://github.com/faceb
236236

237237
| Name | Bytecode size | Bytecode size (gzip)* |
238238
|------------------------------|--------------:|----------------------:|
239-
| `unicode-segmenter/grapheme` | 21,001 | 11,063 |
239+
| `unicode-segmenter/grapheme` | 21,001 | 11,065 |
240240
| `graphemer` | 133,978 | 31,713 |
241241
| `grapheme-splitter` | 63,835 | 19,137 |
242242

src/grapheme.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function* graphemeSegments(input) {
4949
if (cp == null) return;
5050

5151
/** Current cursor position. */
52-
let cursor = cp < 0xFFFF ? 1 : 2;
52+
let cursor = cp <= 0xFFFF ? 1 : 2;
5353

5454
/** Total length of the input string. */
5555
let len = input.length;
@@ -137,7 +137,7 @@ export function* graphemeSegments(input) {
137137
_hd = cp;
138138
}
139139

140-
cursor += cp < 0xFFFF ? 1 : 2;
140+
cursor += cp <= 0xFFFF ? 1 : 2;
141141
catBefore = catAfter;
142142
}
143143

0 commit comments

Comments
 (0)