js_regex 3.11.0 → 3.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/js_regex/converter/set_converter.rb +11 -1
- data/lib/js_regex/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4152eef358fa4cdee93ac92b3a2b16590e49be305e81b53e88732ba11eade1f7
|
4
|
+
data.tar.gz: 7e43bd8ec3ab16a2512769e49508e655f53960353646937b840777c71406af3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e98d601411d6afd3b2ae10df1b18389109a647d4c2ca5e548cb12831badf20ca31de72a20c4fdc93c971aebf3b694623a586e9d1bdc6741084d46bc05a492bfd
|
7
|
+
data.tar.gz: fd337def96701bc627d09bceb921ba50f341ace408533128b8f8fe4a806d1757805ac2437bc864c3a6c82567190f88c760924a1f0f2df23863cbc15c781ca0e1
|
@@ -72,7 +72,11 @@ class JsRegex
|
|
72
72
|
EscapeConverter::ESCAPES_SHARED_BY_RUBY_AND_JS
|
73
73
|
|
74
74
|
def full_recalculation
|
75
|
-
|
75
|
+
# Fetch codepoints as if the set was case-sensitive, then re-add
|
76
|
+
# case-insensitivity if needed.
|
77
|
+
# This way we preserve the casing of the original set in cases where the
|
78
|
+
# whole regexp is case-insensitive, e.g. /[ABc]/i => /[ABc]/i.
|
79
|
+
content = original_case_character_set
|
76
80
|
if expression.case_insensitive? && !context.case_insensitive_root
|
77
81
|
content = content.case_insensitive
|
78
82
|
elsif !expression.case_insensitive? && context.case_insensitive_root
|
@@ -85,6 +89,12 @@ class JsRegex
|
|
85
89
|
content.to_s_with_surrogate_ranges
|
86
90
|
end
|
87
91
|
end
|
92
|
+
|
93
|
+
def original_case_character_set
|
94
|
+
neutral_set = expression.dup
|
95
|
+
neutral_set.each_expression(true) { |exp| exp.options[:i] = false }
|
96
|
+
CharacterSet.of_expression(neutral_set)
|
97
|
+
end
|
88
98
|
end
|
89
99
|
end
|
90
100
|
end
|
data/lib/js_regex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js_regex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.11.
|
4
|
+
version: 3.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janosch Müller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: character_set
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.5.0.dev
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Converts Ruby regexes to JavaScript regexes.
|