Skip to content

Commit 2975919

Browse files
authored
better-regexp: bump regexp-tree dependency (#1031)
1 parent f89fb25 commit 2975919

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"lodash": "^4.17.20",
4545
"pluralize": "^8.0.0",
4646
"read-pkg-up": "^7.0.1",
47-
"regexp-tree": "^0.1.21",
47+
"regexp-tree": "^0.1.22",
4848
"reserved-words": "^0.1.2",
4949
"safe-regex": "^2.1.1",
5050
"semver": "^7.3.4"

test/better-regex.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ test({
7070
'new RegExp()',
7171

7272
// #472
73-
'/[ ;-]/g'
73+
'/[ ;-]/g',
74+
75+
// #994
76+
'/\\s?\\s?/', // https://github.com/DmitrySoshnikov/regexp-tree/issues/216#issuecomment-762073297
77+
'/\\s{0,2}/'
7478
],
7579
invalid: [
7680
// Literal regex
@@ -270,6 +274,11 @@ test({
270274
'/[ \\n\\t\\r\\f(){}:;@!\'"\\\\\\][#]|\\/(?=\\*)/g',
271275
'/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g'
272276
),
277+
// #994
278+
testCase(
279+
'/\\s?\\s?\\s?/',
280+
'/\\s{0,3}/'
281+
),
273282
// Actual message
274283
{
275284
code: '/[0-9]/',

0 commit comments

Comments
 (0)