From befaac6faaf2c2b1b4e7d7214b072c82fb311b36 Mon Sep 17 00:00:00 2001 From: azu Date: Tue, 28 Jun 2022 22:04:18 +0900 Subject: [PATCH] fix: support `-` with //u flag --- package.json | 2 +- test/snapshots/--should-be-passed/input-patterns.json | 3 +++ test/snapshots/--should-be-passed/input.txt | 1 + test/snapshots/--should-be-passed/output-for-human.md | 11 +++++++++++ .../--should-be-passed/output-for-machine.json | 8 ++++++++ yarn.lock | 7 +------ 6 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 test/snapshots/--should-be-passed/input-patterns.json create mode 100644 test/snapshots/--should-be-passed/input.txt create mode 100644 test/snapshots/--should-be-passed/output-for-human.md create mode 100644 test/snapshots/--should-be-passed/output-for-machine.json diff --git a/package.json b/package.json index f73c0a3..86ddabd 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ ] }, "dependencies": { - "escape-string-regexp": "^2.0.0", + "escape-string-regexp": "^4.0.0", "lodash.sortby": "^4.7.0", "lodash.uniq": "^4.5.0", "lodash.uniqwith": "^4.5.0" diff --git a/test/snapshots/--should-be-passed/input-patterns.json b/test/snapshots/--should-be-passed/input-patterns.json new file mode 100644 index 0000000..7da1b69 --- /dev/null +++ b/test/snapshots/--should-be-passed/input-patterns.json @@ -0,0 +1,3 @@ +[ + "foo-bar" +] diff --git a/test/snapshots/--should-be-passed/input.txt b/test/snapshots/--should-be-passed/input.txt new file mode 100644 index 0000000..3929a1c --- /dev/null +++ b/test/snapshots/--should-be-passed/input.txt @@ -0,0 +1 @@ +foo-bar diff --git a/test/snapshots/--should-be-passed/output-for-human.md b/test/snapshots/--should-be-passed/output-for-human.md new file mode 100644 index 0000000..1498600 --- /dev/null +++ b/test/snapshots/--should-be-passed/output-for-human.md @@ -0,0 +1,11 @@ + +- match text: **foo-bar** +- captures: **[]** +- startIndex: **0** +- endIndex: **7** + +``` +**foo-bar** + +``` + diff --git a/test/snapshots/--should-be-passed/output-for-machine.json b/test/snapshots/--should-be-passed/output-for-machine.json new file mode 100644 index 0000000..85abe6a --- /dev/null +++ b/test/snapshots/--should-be-passed/output-for-machine.json @@ -0,0 +1,8 @@ +[ + { + "match": "foo-bar", + "captures": [], + "startIndex": 0, + "endIndex": 7 + } +] \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 3119351..c39be29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -408,7 +408,7 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@4.0.0: +escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== @@ -418,11 +418,6 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - execa@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"