[Pkg-javascript-commits] [node-expand-brackets] 01/04: New upstream version 2.1.4

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Jan 12 17:10:09 UTC 2018


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository node-expand-brackets.

commit 6b756ea96a4458f148bb4ca9ec538ff4d3856583
Author: Pirate Praveen <praveen at debian.org>
Date:   Fri Jan 12 22:04:34 2018 +0530

    New upstream version 2.1.4
---
 README.md         |  8 ++++----
 lib/compilers.js  |  4 ++++
 package.json      |  4 ++--
 test/wildmatch.js | 29 ++++++++++++++++-------------
 4 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/README.md b/README.md
index 4e174b4..c0e33d0 100644
--- a/README.md
+++ b/README.md
@@ -249,8 +249,8 @@ console.log(res.map);
 
 ### Related projects
 
-* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.")
-* [extglob](https://www.npmjs.com/package/extglob): Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.")
+* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.")
+* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.")
 * [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.")
 * [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/jonschlinkert/nanomatch) | [homepage](https://github.com/jonschlinkert/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)")
 
@@ -262,7 +262,7 @@ Pull requests and stars are always welcome. For bugs and feature requests, [plea
 
 | **Commits** | **Contributor**<br/> | 
 | --- | --- |
-| 63 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 66 | [jonschlinkert](https://github.com/jonschlinkert) |
 | 2 | [MartinKolarik](https://github.com/MartinKolarik) |
 | 2 | [es128](https://github.com/es128) |
 | 1 | [eush77](https://github.com/eush77) |
@@ -299,4 +299,4 @@ Released under the [MIT license](https://github.com/jonschlinkert/expand-bracket
 
 ***
 
-_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 21, 2016._
\ No newline at end of file
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 12, 2016._
\ No newline at end of file
diff --git a/lib/compilers.js b/lib/compilers.js
index 7bb8d93..fbf7fe8 100644
--- a/lib/compilers.js
+++ b/lib/compilers.js
@@ -60,6 +60,10 @@ module.exports = function(brackets) {
         return this.emit('^', node);
       }
 
+      if (/-/.test(inner) && !/(\d-\d|\w-\w)/.test(inner)) {
+        inner = inner.split('-').join('\\-');
+      }
+
       var isNegated = inner.charAt(0) === '^';
       // add slashes to negated brackets, per spec
       if (isNegated && inner.indexOf('/') === -1) {
diff --git a/package.json b/package.json
index 83a4484..1c5233c 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "expand-brackets",
   "description": "Expand POSIX bracket expressions (character classes) in glob patterns.",
-  "version": "2.1.3",
+  "version": "2.1.4",
   "homepage": "https://github.com/jonschlinkert/expand-brackets",
   "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
   "contributors": [
@@ -27,7 +27,7 @@
     "test": "mocha"
   },
   "dependencies": {
-    "debug": "^2.2.0",
+    "debug": "^2.3.3",
     "define-property": "^0.2.5",
     "extend-shallow": "^2.0.1",
     "posix-character-classes": "^0.1.0",
diff --git a/test/wildmatch.js b/test/wildmatch.js
index 1def356..21376c0 100644
--- a/test/wildmatch.js
+++ b/test/wildmatch.js
@@ -83,28 +83,34 @@ describe('original wildmatch', function() {
   });
 
   it('should support Additional tests, including some malformed wildmats', function() {
+    assert(!match.isMatch('$', '[ --]'));
     assert(!match.isMatch('+', '[,-.]'));
     assert(!match.isMatch('-', '[!a-'));
-    assert(!match.isMatch('-', '[[-\\]]'));
+    assert(!match.isMatch('-', '[\\-_]'));
     assert(!match.isMatch('-', '[a-'));
     assert(!match.isMatch('-.]', '[,-.]'));
     assert(!match.isMatch('0', '[ --]'));
+    assert(!match.isMatch('2', '[\\1-\\3]'));
     assert(!match.isMatch('4', '[\\1-\\3]'));
+    assert(!match.isMatch('5', '[--A]'));
     assert(!match.isMatch('[', '[\\\\-^]'));
     assert(!match.isMatch('[', '[]-a]'));
     assert(!match.isMatch('\\', '[!\\\\]'));
+    assert(!match.isMatch('\\', '[[-\\]]'));
     assert(!match.isMatch('\\', '[\\]'));
     assert(!match.isMatch('\\', '[\\]]'));
     assert(!match.isMatch('\\]', '[\\]]'));
-    assert(!match.isMatch('^', '[!]-a]'));
+    assert(!match.isMatch(']', '[\\\\-^]'));
+    assert(!match.isMatch('^', '[]-a]'));
     assert(!match.isMatch('a[]b', 'a[]b'));
     assert(!match.isMatch('ab', '[!'));
     assert(!match.isMatch('ab', '[-'));
     assert(!match.isMatch('ab', 'a[]b'));
     assert(!match.isMatch('acrt', 'a[c-c]st'));
+    assert(!match.isMatch('G', '[A-\\\\]'));
     assert(!match.isMatch('j', '[a-e-n]'));
     assert(match.isMatch(' ', '[ --]'));
-    assert(match.isMatch('$', '[ --]'));
+    assert(match.isMatch(' ', '[-- ]'));
     assert(match.isMatch(',', '[,]'));
     assert(match.isMatch(',', '[\\\\,]'));
     assert(match.isMatch('-', '[ --]'));
@@ -113,26 +119,21 @@ describe('original wildmatch', function() {
     assert(match.isMatch('-', '[---]'));
     assert(match.isMatch('-', '[--A]'));
     assert(match.isMatch('-', '[-]'));
-    assert(match.isMatch('-', '[\\-_]'));
+    assert(match.isMatch('-', '[[-\\]]'));
     assert(match.isMatch('-', '[a-e-n]'));
     assert(match.isMatch('-b]', '[a-]b]'));
-    assert(match.isMatch('2', '[\\1-\\3]'));
     assert(match.isMatch('3', '[\\1-\\3]'));
-    assert(match.isMatch('5', '[--A]'));
     assert(match.isMatch('[', '[!]-a]'));
     assert(match.isMatch('[', '[[-\\]]'));
-    assert(match.isMatch('\\', '[[-\\]]'));
     assert(match.isMatch('\\', '[\\\\,]'));
     assert(match.isMatch('\\', '[\\\\]'));
     assert(match.isMatch(']', '[[-\\]]'));
-    assert(match.isMatch(']', '[\\\\-^]'));
     assert(match.isMatch(']', '[\\]]'));
-    assert(match.isMatch('^', '[]-a]'));
+    assert(match.isMatch('^', '[!]-a]'));
     assert(match.isMatch('^', '[a^bc]'));
     assert(match.isMatch('a', '[!------]'));
     assert(match.isMatch('ab[', 'ab['));
     assert(match.isMatch('acrt', 'a[c-c]rt'));
-    assert(match.isMatch('G', '[A-\\\\]'));
   });
 
   it('should support Case-sensitivy features', function() {
@@ -168,9 +169,11 @@ describe('original wildmatch', function() {
   });
 
   it('should support Additional tests not found in the original wildmatch', function() {
-    assert(!match.isMatch('-', '[]-z]'));
+    assert(match.isMatch('-', '[]-z]'));
     assert(match.isMatch('-', '[[:space:]-\\]]'));
-    assert(match.isMatch('c', '[[:space:]-z]'));
-    assert(match.isMatch('c', '[]-z]'));
+    assert(match.isMatch(']', '[[:space:]-\\]]'));
+    assert(!match.isMatch('[', '[[:space:]-\\]]'));
+    assert(!match.isMatch('c', '[[:space:]-z]'));
+    assert(!match.isMatch('c', '[]-z]'));
   });
 });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-expand-brackets.git



More information about the Pkg-javascript-commits mailing list