Skip to content

Commit

Permalink
Version Packages (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Apr 18, 2024
1 parent 3e6c516 commit 0b622ee
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 76 deletions.
5 changes: 0 additions & 5 deletions .changeset/calm-maps-tickle.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/clever-cherries-nail.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/five-beers-act.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/flat-mugs-film.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/healthy-horses-relate.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rude-drinks-taste.md

This file was deleted.

34 changes: 0 additions & 34 deletions .changeset/small-moles-carry.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/thin-chicken-drive.md

This file was deleted.

53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
# unicode-segmenter

## 0.3.0

### Minor Changes

- c74c6a0: Expose `/utils` entry with a helpful API

- `takeChar(input, cursor)`: take a utf8 character from given input by cursor

- c3ceaa5: Add `countGrapheme` utility
- 955814a: Expose some low-level APIs that might help other dependents
- 7592c3b: - New entries for Unicode's general and emoji properties

```js
import {
isLetter, // match w/ \p{L}
isNumeric, // match w/ \p{N}
isAlphabetic, // match w/ \p{Alphabetic}
isAlphanumeric, // match w/ [\p{N}\p{Alphabetic}]
} from "unicode-segmenter/general";

import {
isEmoji, // match w/ \p{Extended_Pictographic}
isEmojiPresentation, // match w/ \p{Emoji_Presentation}
} from "unicode-segmenter/emoji";
```

- Grapheme segementer now yields matched category to `_cat` field.
It will be useful when building custom matchers by the category

e.g. custom emoji matcher:

```js
function* matchEmoji(str) {
for (let { index, segment, input, _cat } of graphemeSegments(str)) {
if (_cat === GraphemeCategory.Extended_Pictographic) {
yield { emoji: segment, index };
}
}
}
```

- 7592c3b: Add more low-level utilities

- `isHighSurrogate` check if a UTF-16 code in high surrogate
- `isLowSurragate` check if a UTF-16 code in low surrogate
- `surrogatePairToCodePoint` convert given surrogate pair to a Unicode code point

### Patch Changes

- 7592c3b: Correct some type definitions
- 900f959: Optimize perf again
- 3db955b: Fix edge cases around ZWJ

## 0.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unicode-segmenter",
"version": "0.2.0",
"version": "0.3.0",
"type": "module",
"description": "A lightweight and fast, pure JavaScript library for Unicode segmentation",
"license": "MIT",
Expand Down

0 comments on commit 0b622ee

Please sign in to comment.