[Pkg-javascript-commits] [node-brace-expansion] 01/06: New upstream version 1.1.6
Sruthi Chandran
srud-guest at moszumanska.debian.org
Tue Oct 25 17:09:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
srud-guest pushed a commit to branch master
in repository node-brace-expansion.
commit e355d2fd351ddaffb80793c7680c1f3086807b83
Author: Sruthi <srud at disroot.org>
Date: Tue Oct 25 22:21:00 2016 +0530
New upstream version 1.1.6
---
.npmignore | 5 +++++
.travis.yml | 3 +++
README.md | 1 +
index.js | 12 +++++++++++-
package.json | 6 +++---
test/bash-results.txt | 13 +++++++++++--
test/cases.txt | 7 ++++++-
test/generate.sh | 0
8 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..247e5cf
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,5 @@
+test
+.gitignore
+.travis.yml
+example.js
+.npmignore
diff --git a/.travis.yml b/.travis.yml
index 6e5919d..ecd4193 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,6 @@
language: node_js
node_js:
- "0.10"
+ - "0.12"
+ - "4"
+ - "6"
diff --git a/README.md b/README.md
index 62bc7ba..1793929 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@
as known from sh/bash, in JavaScript.
[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)
+[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)
diff --git a/index.js b/index.js
index a23104e..955f27c 100644
--- a/index.js
+++ b/index.js
@@ -66,6 +66,16 @@ function expandTop(str) {
if (!str)
return [];
+ // I don't know why Bash 4.3 does this, but it does.
+ // Anything starting with {} will have the first two bytes preserved
+ // but *only* at the top level, so {},a}b will not expand to anything,
+ // but a{},b}c will be expanded to [a}c,abc].
+ // One could argue that this is a bug in Bash, but since the goal of
+ // this module is to match Bash's rules, we escape a leading {}
+ if (str.substr(0, 2) === '{}') {
+ str = '\\{\\}' + str.substr(2);
+ }
+
return expand(escapeBraces(str), true).map(unescapeBraces);
}
@@ -99,7 +109,7 @@ function expand(str, isTop) {
var isOptions = /^(.*,)+(.+)?$/.test(m.body);
if (!isSequence && !isOptions) {
// {a},b}
- if (m.post.match(/,.*}/)) {
+ if (m.post.match(/,.*\}/)) {
str = m.pre + '{' + m.body + escClose + m.post;
return expand(str);
}
diff --git a/package.json b/package.json
index 69d7385..0ce5829 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "brace-expansion",
"description": "Brace expansion as known from sh/bash",
- "version": "1.1.0",
+ "version": "1.1.6",
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/brace-expansion.git"
@@ -13,11 +13,11 @@
"gentest": "bash test/generate.sh"
},
"dependencies": {
- "balanced-match": "^0.2.0",
+ "balanced-match": "^0.4.1",
"concat-map": "0.0.1"
},
"devDependencies": {
- "tape": "^3.0.3"
+ "tape": "^4.6.0"
},
"keywords": [],
"author": {
diff --git a/test/bash-results.txt b/test/bash-results.txt
index 958148d..b4510c0 100644
--- a/test/bash-results.txt
+++ b/test/bash-results.txt
@@ -1071,5 +1071,14 @@ A{b,{d,e},{f,g}}Z
[{1..f}]><><><><{1..0f}
[{1..0f}]><><><><{1..10f}
[{1..10f}]><><><><{1..10.f}
-[{1..10.f}]><><><><{1..10.f}
-[{1..10.f}]><><><><
\ No newline at end of file
+[{1..10.f}]><><><><{},b}.h
+[{},b}.h]><><><><y{},a}x
+[y}x]
+[yax]><><><><{}{},a}b
+[{}}b]
+[{}ab]><><><><{{},a}}b
+[{}}b]
+[a}b]><><><><{}{{},a}}b
+[{}{}}b]
+[{}a}b]><><><><{}a,b}c
+[{}a,b}c]><><><><
\ No newline at end of file
diff --git a/test/cases.txt b/test/cases.txt
index e5161c3..b885b57 100644
--- a/test/cases.txt
+++ b/test/cases.txt
@@ -179,4 +179,9 @@ a-{bdef-{g,i}-c
{1..0f}
{1..10f}
{1..10.f}
-{1..10.f}
+{},b}.h
+y{},a}x
+{}{},a}b
+{{},a}}b
+{}{{},a}}b
+{}a,b}c
diff --git a/test/generate.sh b/test/generate.sh
old mode 100644
new mode 100755
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-brace-expansion.git
More information about the Pkg-javascript-commits
mailing list