Releases: slevithan/oniguruma-to-es
Releases · slevithan/oniguruma-to-es
v1.0.0
Most of the changes and fixes in this release resulted from feedback by @RedCMD. ✨
🚨 Breaking
- Redesigned the recursion depth limit around the fact that Oniguruma uses a limit of
20
(rather than an infinite or high-value depth like other regex flavors). (#19)- Moved option
maxRecursionDepth
torules.recursionLimit
. - Changed the default
recursionLimit
from5
to20
. - Reduced the max
recursionLimit
from100
to20
. - Removed the ability to disable support for recursion.
- Setting
accuracy
to'strict'
no longer disables recursion.
- Moved option
🚀 Features
- Support
\x{…}
values above10FFFF
at the end of character class ranges. (#22) - Validate lookbehind contents and throw if not supported by Oniguruma. (#24)
- Support possessive interval quantifiers specified using a reversed range. (#25)
- Error at compile time rather than runtime for Unicode property names that start with a digit.
- Improved test coverage.
🐞 Fixes
- Don't remove negation for negated character classes used in intersection that contain a single token (bug applied when using
target
ES2024
or later and optionverbose
not enabled). - Ignore insignificant hyphens in Unicode property names. (#16)
- Don't throw for intersection with an empty set. (#17)
- Don't throw for character class ranges ending with literal hyphens followed by character or character-set tokens. (#18)
v0.10.0
🚨 Breaking
toDetails
: Thesubclass
property on result objects was renamed asoptions
, for consistency withEmulatedRegExp
.
🚀 Features
- Added a
rawArgs
property toEmulatedRegExp
instances that can be used to serialize the object. - Added support for use of lone
\G
in any top-level alternative. - Environment support for duplicate group names is no longer required as a condition for
target
auto
to useES2025
. - Improved
EmulatedRegExp
types.
🐞 Fixes
- With
target
ES2025
: Subpattern details on match results did not match Oniguruma in some cases when duplicate group names were used across mutually exclusive alternation paths. Results are now the same across alltarget
s. (#14) - With pre-
ES2025
target
s: Duplicate characters were added in edge cases during mixed case-insensitivity expansion of character class ranges that included the same character in multiple cases. This had no effect on resulting matches, but generated regex source is now cleaner in these cases.
v0.9.0
🚨 Breaking
- Option
allowUnhandledGAnchors
renamed asignoreUnsupportedGAnchors
.
🚀 Features
- Externalized dependencies for the ESM bundle. (#12, @bluwy)
- No longer restricting Unicode properties based on
target
. (#10)
🐞 Fixes
- Switched to preserving duplicate group names on the first instance (rather than the last per mutually exclusive alternation path), to match Oniguruma's match results in cases affected by subroutines and duplicate group names.
- When option
avoidSubclass
is not enabled:- Hide subpattern details from match results for captures created by emulated subroutines.
- Transfer subroutine (and descendent) capture details on match results to the indexes of groups they reference (if preceding) to match Oniguruma's subpattern match results/ordering.
v0.8.1
v0.8.0
🚨 Breaking
- When option
allowUnhandledGAnchors
is enabled, an unsupported use of\G
no longer adds flagy
(provides better tradeoffs).
🚀 Features
- Added option
rules.captureGroup
(equivalent to Oniguruma compile-time optionONIG_OPTION_CAPTURE_GROUP
) totoDetails
,toRegExp
, andtoOnigurumaAst
. Allows unnamed captures and numbered backreferences/subroutines when using named capture (with complex resulting rules in edge cases).
🐞 Fixes
- Prevent
^
from matching after a string-terminating line feed. (#9) - When option
avoidSubclass
is not enabled, use emulation groups (which prevent captured values from appearing on match results) for copies of capturing groups created by recursion.
v0.7.0
v0.6.1
v0.6.0
🚨 Breaking
- Replaced option
accuracy: 'loose'
withrules.allowUnhandledGAnchors
. - Replaced option
tmGrammar
withrules.allowOrphanBackrefs
.
🚀 Features
- Added support for flags
D
(Digit is ASCII) andS
(Space is ASCII) at top-level. - Added option
rules.asciiWordBoundaries
.
🐞 Fixes
\w
,\d
,\s
, and their inversions are Unicode-based by default. (#4)- Unicode combining marks qualify as
\b
word boundaries by default. - In edge cases, using nested character classes that combined union and intersection led to invalid patterns.
- In edge cases, some characters were not escaped appropriately in nested character classes.