@@ -32,17 +32,16 @@ Unicode® Standard Annex \#29 - [Revision 45](https://www.unicode.org/reports/tr
3232
3333## APIs
3434
35- There are several entries for text segmentation.
35+ Entries for Unicode text segmentation.
3636
3737- [ ` unicode-segmenter/grapheme ` ] ( #export-unicode-segmentergrapheme ) : Segments and counts ** extended grapheme clusters**
3838- [ ` unicode-segmenter/intl-adapter ` ] ( #export-unicode-segmenterintl-adapter ) : [ ` Intl.Segmenter ` ] adapter
3939- [ ` unicode-segmenter/intl-polyfill ` ] ( #export-unicode-segmenterintl-polyfill ) : [ ` Intl.Segmenter ` ] polyfill
4040
41- And extra utilities for combined use cases.
41+ And matchers for extra use cases.
4242
4343- [ ` unicode-segmenter/emoji ` ] ( #export-unicode-segmenteremoji ) : Matches single codepoint emojis
4444- [ ` unicode-segmenter/general ` ] ( #export-unicode-segmentergeneral ) : Matches single codepoint alphanumerics
45- - [ ` unicode-segmenter/utils ` ] ( #export-unicode-segmenterutils ) : Some utilities for handling codepoints
4645
4746### Export ` unicode-segmenter/grapheme `
4847[ ![ ] ( https://edge.bundlejs.com/badge?q=unicode-segmenter/grapheme&treeshake=[*] )] ( https://bundlejs.com/?q=unicode-segmenter%2Fgrapheme&treeshake=%5B*%5D )
@@ -187,42 +186,6 @@ import {
187186} from ' unicode-segmenter/general' ;
188187```
189188
190- ### Export ` unicode-segmenter/utils `
191- [ ![ ] ( https://edge.bundlejs.com/badge?q=unicode-segmenter/utils&treeshake=[*] )] ( https://bundlejs.com/?q=unicode-segmenter%2Futils&treeshake=%5B*%5D )
192-
193- You can access some internal utilities to deal with JavaScript strings.
194-
195- #### Example: Handle UTF-16 surrogate pairs
196-
197- ``` js
198- import {
199- isHighSurrogate ,
200- isLowSurrogate ,
201- surrogatePairToCodePoint ,
202- } from ' unicode-segmenter/utils' ;
203-
204- const u32 = ' 😍' ;
205- const hi = u32 .charCodeAt (0 );
206- const lo = u32 .charCodeAt (1 );
207-
208- if (isHighSurrogate (hi) && isLowSurrogate (lo)) {
209- const codePoint = surrogatePairToCodePoint (hi, lo);
210- // => equivalent to u32.codePointAt(0)
211- }
212- ```
213-
214- #### Example: Determine the length of a character
215-
216- ``` js
217- import { isBMP } from ' unicode-segmenter/utils' ;
218-
219- const char = ' 😍' ; // .length = 2
220- const cp = char .codePointAt (0 );
221-
222- char .length === isBMP (cp) ? 1 : 2 ;
223- // => true
224- ```
225-
226189## Runtime Compatibility
227190
228191` unicode-segmenter ` uses only fundamental features of ES2015, making it compatible with most browsers.
0 commit comments