js_regex 3.10.0 → 3.11.0
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 +3 -0
- data/lib/js_regex/target.rb +1 -1
- data/lib/js_regex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c55b0dded778c8851267d5d6d24c4a1afcbdb64e6d28ef3e48da5ba8acaf4d8
|
4
|
+
data.tar.gz: 71cf3ead5808405c0e32a2fa2dd63a8efa6f5f02df9ef707c12d4238087121a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5cb89a802b4c90382146f6a49e2c0fbefa5aed7580d0698e8bd392e05ed172880a713dc619b484e9fa0f28689b1b03c35eb08f9efc6673895ca1a450985723e
|
7
|
+
data.tar.gz: c0c8fda9db5419e5d05b43036190d1fb3d9e44d32c7f57598f21cb6c16d444208dae18ed6cdeb871357188619113475f83deb70c4eef2babfc44a37c27cbbbb9
|
@@ -55,6 +55,8 @@ class JsRegex
|
|
55
55
|
TypeConverter.directly_compatible?(exp, context) &&
|
56
56
|
exp.text
|
57
57
|
when :escape
|
58
|
+
return exp.text if SET_SPECIFIC_ESCAPES_PATTERN.match?(exp.text)
|
59
|
+
|
58
60
|
case exp.token
|
59
61
|
when *CONVERTIBLE_ESCAPE_TOKENS
|
60
62
|
EscapeConverter.new.convert(exp, context)
|
@@ -65,6 +67,7 @@ class JsRegex
|
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
70
|
+
SET_SPECIFIC_ESCAPES_PATTERN = /[\^\-]/
|
68
71
|
CONVERTIBLE_ESCAPE_TOKENS = %i[control meta_sequence bell escape octal] +
|
69
72
|
EscapeConverter::ESCAPES_SHARED_BY_RUBY_AND_JS
|
70
73
|
|
data/lib/js_regex/target.rb
CHANGED
@@ -8,7 +8,7 @@ class JsRegex
|
|
8
8
|
def self.cast(arg)
|
9
9
|
return ES2009 if arg.nil?
|
10
10
|
|
11
|
-
normalized_arg = arg.to_s.upcase
|
11
|
+
normalized_arg = arg.to_s.upcase.sub(/^(ECMASCRIPT|ES|JAVASCRIPT|JS)? ?/, 'ES')
|
12
12
|
return normalized_arg if SUPPORTED.include?(normalized_arg)
|
13
13
|
|
14
14
|
raise ArgumentError.new(
|
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.
|
4
|
+
version: 3.11.0
|
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: 2023-
|
11
|
+
date: 2023-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: character_set
|