Skip to content

Commit ab9c462

Browse files
committed
chore: review
1 parent c54ade6 commit ab9c462

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/constructs/character-class.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ export function negated(element: CharacterClass): CharacterClass {
152152
};
153153
}
154154

155+
/**
156+
* @deprecated Renamed to `negated`.
157+
*/
158+
export const inverted = negated;
159+
155160
function encodeCharacterClass(this: CharacterClass): EncodeResult {
156161
if (this.chars.length === 0 && this.ranges.length === 0) {
157162
throw new Error('Character class should contain at least one character or character range');

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export {
1717
charRange,
1818
digit,
1919
negated,
20+
inverted,
2021
nonDigit,
2122
nonWhitespace,
2223
nonWord,

website/docs/api/assertions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ _This API was added in version 1.3.0._
2323

2424
```ts
2525
const wordBoundary: Anchor;
26-
const notWordBoundary: Anchor;
26+
const nonWordBoundary: Anchor;
2727
```
2828

2929
- `wordBoundary` matches the positions where a word character is not followed or preceded by another word character, effectively indicating the start or end of a word. Regex syntax: `\b`.
30-
- `notWordBoundary` matches the positions where a word character is followed or preceded by another word character, indicating that it is not at the start or end of a word. Regex syntax: `\B`.
30+
- `nonWordBoundary` matches the positions where a word character is followed or preceded by another word character, indicating that it is not at the start or end of a word. Regex syntax: `\B`.
3131

3232
Note: word characters are letters, digits, and underscore (`_`). Other special characters like `#`, `$`, etc are not considered word characters.
3333

0 commit comments

Comments
 (0)