aboutsummaryrefslogtreecommitdiff
path: root/node_modules/glob-parent
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/glob-parent')
-rw-r--r--node_modules/glob-parent/.travis.yml8
-rw-r--r--node_modules/glob-parent/README.md22
-rw-r--r--node_modules/glob-parent/appveyor.yml25
-rw-r--r--node_modules/glob-parent/index.js5
-rw-r--r--node_modules/glob-parent/node_modules/is-extglob/LICENSE21
-rw-r--r--node_modules/glob-parent/node_modules/is-extglob/README.md107
-rw-r--r--node_modules/glob-parent/node_modules/is-extglob/index.js20
-rw-r--r--node_modules/glob-parent/node_modules/is-extglob/package.json69
-rw-r--r--node_modules/glob-parent/node_modules/is-glob/LICENSE21
-rw-r--r--node_modules/glob-parent/node_modules/is-glob/README.md142
-rw-r--r--node_modules/glob-parent/node_modules/is-glob/index.js25
-rw-r--r--node_modules/glob-parent/node_modules/is-glob/package.json80
-rw-r--r--node_modules/glob-parent/package.json104
-rw-r--r--node_modules/glob-parent/test.js103
14 files changed, 663 insertions, 89 deletions
diff --git a/node_modules/glob-parent/.travis.yml b/node_modules/glob-parent/.travis.yml
index 18fc42f69..a404ceb22 100644
--- a/node_modules/glob-parent/.travis.yml
+++ b/node_modules/glob-parent/.travis.yml
@@ -1,8 +1,8 @@
language: node_js
node_js:
+ - "6"
+ - "5"
- "4"
- - "iojs-v3"
- - "iojs-v2"
- - "iojs-v1"
- - "0.12"
- "0.10"
+script:
+ - npm run ci-test
diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md
index ff5310d3b..243ff9ccf 100644
--- a/node_modules/glob-parent/README.md
+++ b/node_modules/glob-parent/README.md
@@ -11,6 +11,8 @@ Usage
npm install glob-parent --save
```
+**Examples**
+
```js
var globParent = require('glob-parent');
@@ -31,7 +33,27 @@ globParent('path/**/*'); // 'path'
globParent('path/foo/bar.js'); // 'path/foo'
globParent('path/foo/'); // 'path/foo'
globParent('path/foo'); // 'path' (see issue #3 for details)
+```
+
+## Escaping
+
+The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters:
+- `?` (question mark)
+- `*` (star)
+- `|` (pipe)
+- `(` (opening parenthesis)
+- `)` (closing parenthesis)
+- `{` (opening curly brace)
+- `}` (closing curly brace)
+- `[` (opening bracket)
+- `]` (closing bracket)
+
+**Example**
+
+```js
+globParent('foo/[bar]/') // 'foo'
+globParent('foo/\\[bar]/') // 'foo/[bar]'
```
Change Log
diff --git a/node_modules/glob-parent/appveyor.yml b/node_modules/glob-parent/appveyor.yml
new file mode 100644
index 000000000..eb932544d
--- /dev/null
+++ b/node_modules/glob-parent/appveyor.yml
@@ -0,0 +1,25 @@
+
+# Test against this version of Node.js
+environment:
+ matrix:
+ - nodejs_version: "6"
+ - nodejs_version: "5"
+ - nodejs_version: "4"
+
+# Install scripts. (runs after repo cloning)
+install:
+ # Get the latest stable version of Node.js or io.js
+ - ps: Install-Product node $env:nodejs_version
+ # install modules
+ - npm install
+
+# Post-install test scripts.
+test_script:
+ # Output useful info for debugging.
+ - node --version
+ - npm --version
+ # run tests
+ - npm test
+
+# Don't actually build.
+build: off
diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js
index 61615f1ac..9a7e59375 100644
--- a/node_modules/glob-parent/index.js
+++ b/node_modules/glob-parent/index.js
@@ -2,9 +2,10 @@
var path = require('path');
var isglob = require('is-glob');
+var pathDirname = require('path-dirname');
module.exports = function globParent(str) {
str += 'a'; // preserves full path in case of trailing path separator
- do {str = path.dirname(str)} while (isglob(str));
- return str;
+ do {str = pathDirname.posix(str)} while (isglob(str));
+ return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
};
diff --git a/node_modules/glob-parent/node_modules/is-extglob/LICENSE b/node_modules/glob-parent/node_modules/is-extglob/LICENSE
new file mode 100644
index 000000000..842218cf0
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-extglob/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2016, Jon Schlinkert
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/glob-parent/node_modules/is-extglob/README.md b/node_modules/glob-parent/node_modules/is-extglob/README.md
new file mode 100644
index 000000000..0416af5c3
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-extglob/README.md
@@ -0,0 +1,107 @@
+# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob)
+
+> Returns true if a string has an extglob.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save is-extglob
+```
+
+## Usage
+
+```js
+var isExtglob = require('is-extglob');
+```
+
+**True**
+
+```js
+isExtglob('?(abc)');
+isExtglob('@(abc)');
+isExtglob('!(abc)');
+isExtglob('*(abc)');
+isExtglob('+(abc)');
+```
+
+**False**
+
+Escaped extglobs:
+
+```js
+isExtglob('\\?(abc)');
+isExtglob('\\@(abc)');
+isExtglob('\\!(abc)');
+isExtglob('\\*(abc)');
+isExtglob('\\+(abc)');
+```
+
+Everything else...
+
+```js
+isExtglob('foo.js');
+isExtglob('!foo.js');
+isExtglob('*.js');
+isExtglob('**/abc.js');
+isExtglob('abc/*.js');
+isExtglob('abc/(aaa|bbb).js');
+isExtglob('abc/[a-z].js');
+isExtglob('abc/{a,b}.js');
+isExtglob('abc/?.js');
+isExtglob('abc.js');
+isExtglob('abc/def/ghi.js');
+```
+
+## History
+
+**v2.0**
+
+Adds support for escaping. Escaped exglobs no longer return true.
+
+## About
+
+### Related projects
+
+* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.")
+* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
+* [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.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Building docs
+
+_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
+
+To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
+
+```sh
+$ npm install -g verb verb-generate-readme && verb
+```
+
+### Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm install -d && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file
diff --git a/node_modules/glob-parent/node_modules/is-extglob/index.js b/node_modules/glob-parent/node_modules/is-extglob/index.js
new file mode 100644
index 000000000..c1d986fc5
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-extglob/index.js
@@ -0,0 +1,20 @@
+/*!
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
+ *
+ * Copyright (c) 2014-2016, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+module.exports = function isExtglob(str) {
+ if (typeof str !== 'string' || str === '') {
+ return false;
+ }
+
+ var match;
+ while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
+ if (match[2]) return true;
+ str = str.slice(match.index + match[0].length);
+ }
+
+ return false;
+};
diff --git a/node_modules/glob-parent/node_modules/is-extglob/package.json b/node_modules/glob-parent/node_modules/is-extglob/package.json
new file mode 100644
index 000000000..ccfd41fa4
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-extglob/package.json
@@ -0,0 +1,69 @@
+{
+ "name": "is-extglob",
+ "description": "Returns true if a string has an extglob.",
+ "version": "2.1.0",
+ "homepage": "https://github.com/jonschlinkert/is-extglob",
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "repository": "jonschlinkert/is-extglob",
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/is-extglob/issues"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js"
+ ],
+ "main": "index.js",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "devDependencies": {
+ "gulp-format-md": "^0.1.10",
+ "mocha": "^3.0.2"
+ },
+ "keywords": [
+ "bash",
+ "braces",
+ "check",
+ "exec",
+ "expression",
+ "extglob",
+ "glob",
+ "globbing",
+ "globstar",
+ "is",
+ "match",
+ "matches",
+ "pattern",
+ "regex",
+ "regular",
+ "string",
+ "test"
+ ],
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "has-glob",
+ "is-glob",
+ "micromatch"
+ ]
+ },
+ "reflinks": [
+ "verb",
+ "verb-generate-readme"
+ ],
+ "lint": {
+ "reflinks": true
+ }
+ }
+}
diff --git a/node_modules/glob-parent/node_modules/is-glob/LICENSE b/node_modules/glob-parent/node_modules/is-glob/LICENSE
new file mode 100644
index 000000000..39245ac1c
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-glob/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2016, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/glob-parent/node_modules/is-glob/README.md b/node_modules/glob-parent/node_modules/is-glob/README.md
new file mode 100644
index 000000000..6f4404fec
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-glob/README.md
@@ -0,0 +1,142 @@
+# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-glob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-glob)
+
+> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save is-glob
+```
+
+You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob).
+
+## Usage
+
+```js
+var isGlob = require('is-glob');
+```
+
+**True**
+
+Patterns that have glob characters or regex patterns will return `true`:
+
+```js
+isGlob('!foo.js');
+isGlob('*.js');
+isGlob('**/abc.js');
+isGlob('abc/*.js');
+isGlob('abc/(aaa|bbb).js');
+isGlob('abc/[a-z].js');
+isGlob('abc/{a,b}.js');
+isGlob('abc/?.js');
+//=> true
+```
+
+Extglobs
+
+```js
+isGlob('abc/@(a).js');
+isGlob('abc/!(a).js');
+isGlob('abc/+(a).js');
+isGlob('abc/*(a).js');
+isGlob('abc/?(a).js');
+//=> true
+```
+
+**False**
+
+Escaped globs or extglobs return `false`:
+
+```js
+isGlob('abc/\\@(a).js');
+isGlob('abc/\\!(a).js');
+isGlob('abc/\\+(a).js');
+isGlob('abc/\\*(a).js');
+isGlob('abc/\\?(a).js');
+isGlob('\\!foo.js');
+isGlob('\\*.js');
+isGlob('\\*\\*/abc.js');
+isGlob('abc/\\*.js');
+isGlob('abc/\\(aaa|bbb).js');
+isGlob('abc/\\[a-z].js');
+isGlob('abc/\\{a,b}.js');
+isGlob('abc/\\?.js');
+//=> false
+```
+
+Patterns that do not have glob patterns return `false`:
+
+```js
+isGlob('abc.js');
+isGlob('abc/def/ghi.js');
+isGlob('foo.js');
+isGlob('abc/@.js');
+isGlob('abc/+.js');
+isGlob();
+isGlob(null);
+//=> false
+```
+
+Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)):
+
+```js
+isGlob(['**/*.js']);
+isGlob(['foo.js']);
+//=> false
+```
+
+## About
+
+### Related projects
+
+* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
+* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.")
+* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.")
+* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Contributors
+
+| **Commits** | **Contributor**<br/> |
+| --- | --- |
+| 40 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 1 | [tuvistavie](https://github.com/tuvistavie) |
+
+### Building docs
+
+_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
+
+To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
+
+```sh
+$ npm install -g verb verb-generate-readme && verb
+```
+
+### Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm install -d && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT license](https://github.com/jonschlinkert/is-glob/blob/master/LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file
diff --git a/node_modules/glob-parent/node_modules/is-glob/index.js b/node_modules/glob-parent/node_modules/is-glob/index.js
new file mode 100644
index 000000000..2ecbe2a74
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-glob/index.js
@@ -0,0 +1,25 @@
+/*!
+ * is-glob <https://github.com/jonschlinkert/is-glob>
+ *
+ * Copyright (c) 2014-2016, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+var isExtglob = require('is-extglob');
+
+module.exports = function isGlob(str) {
+ if (typeof str !== 'string' || str === '') {
+ return false;
+ }
+
+ if (isExtglob(str)) return true;
+
+ var regex = /(\\).|([*?]|\[.*\]|\{.*\}|\(.*\|.*\)|^!)/;
+ var match;
+
+ while ((match = regex.exec(str))) {
+ if (match[2]) return true;
+ str = str.slice(match.index + match[0].length);
+ }
+ return false;
+};
diff --git a/node_modules/glob-parent/node_modules/is-glob/package.json b/node_modules/glob-parent/node_modules/is-glob/package.json
new file mode 100644
index 000000000..53a137d8c
--- /dev/null
+++ b/node_modules/glob-parent/node_modules/is-glob/package.json
@@ -0,0 +1,80 @@
+{
+ "name": "is-glob",
+ "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.",
+ "version": "3.1.0",
+ "homepage": "https://github.com/jonschlinkert/is-glob",
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "contributors": [
+ "Daniel Perez <daniel@claudetech.com> (http://tuvistavie.com)",
+ "Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)"
+ ],
+ "repository": "jonschlinkert/is-glob",
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/is-glob/issues"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js"
+ ],
+ "main": "index.js",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "dependencies": {
+ "is-extglob": "^2.1.0"
+ },
+ "devDependencies": {
+ "gulp-format-md": "^0.1.10",
+ "mocha": "^3.0.2"
+ },
+ "keywords": [
+ "bash",
+ "braces",
+ "check",
+ "exec",
+ "expression",
+ "extglob",
+ "glob",
+ "globbing",
+ "globstar",
+ "is",
+ "match",
+ "matches",
+ "pattern",
+ "regex",
+ "regular",
+ "string",
+ "test"
+ ],
+ "verb": {
+ "layout": "default",
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "assemble",
+ "base",
+ "update",
+ "verb"
+ ]
+ },
+ "reflinks": [
+ "assemble",
+ "bach",
+ "base",
+ "composer",
+ "gulp",
+ "has-glob",
+ "is-valid-glob",
+ "micromatch",
+ "npm",
+ "scaffold",
+ "verb",
+ "vinyl"
+ ]
+ }
+}
diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json
index ac6800e6f..61b91bcee 100644
--- a/node_modules/glob-parent/package.json
+++ b/node_modules/glob-parent/package.json
@@ -1,93 +1,39 @@
{
- "_args": [
- [
- {
- "raw": "glob-parent@^2.0.0",
- "scope": null,
- "escapedName": "glob-parent",
- "name": "glob-parent",
- "rawSpec": "^2.0.0",
- "spec": ">=2.0.0 <3.0.0",
- "type": "range"
- },
- "/home/dold/repos/taler/wallet-webex/node_modules/glob-base"
- ]
- ],
- "_from": "glob-parent@>=2.0.0 <3.0.0",
- "_id": "glob-parent@2.0.0",
- "_inCache": true,
- "_location": "/glob-parent",
- "_nodeVersion": "3.0.0",
- "_npmUser": {
- "name": "es128",
- "email": "elan.shanker+npm@gmail.com"
- },
- "_npmVersion": "2.13.3",
- "_phantomChildren": {},
- "_requested": {
- "raw": "glob-parent@^2.0.0",
- "scope": null,
- "escapedName": "glob-parent",
- "name": "glob-parent",
- "rawSpec": "^2.0.0",
- "spec": ">=2.0.0 <3.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/glob-base"
- ],
- "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
- "_shasum": "81383d72db054fcccf5336daa902f182f6edbb28",
- "_shrinkwrap": null,
- "_spec": "glob-parent@^2.0.0",
- "_where": "/home/dold/repos/taler/wallet-webex/node_modules/glob-base",
- "author": {
- "name": "Elan Shanker"
- },
- "bugs": {
- "url": "https://github.com/es128/glob-parent/issues"
- },
- "dependencies": {
- "is-glob": "^2.0.0"
- },
- "description": "Strips glob magic from a string to provide the parent path",
- "devDependencies": {
- "coveralls": "^2.11.2",
- "istanbul": "^0.3.5",
- "mocha": "^2.1.0"
+ "name": "glob-parent",
+ "version": "3.0.1",
+ "description": "Strips glob magic from a string to provide the parent directory path",
+ "main": "index.js",
+ "scripts": {
+ "test": "istanbul test node_modules/mocha/bin/_mocha",
+ "ci-test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
},
- "directories": {},
- "dist": {
- "shasum": "81383d72db054fcccf5336daa902f182f6edbb28",
- "tarball": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz"
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/es128/glob-parent"
},
- "gitHead": "a956910c7ccb5eafd1b3fe900ceb6335cc5b6d3d",
- "homepage": "https://github.com/es128/glob-parent",
"keywords": [
"glob",
"parent",
"strip",
"path",
+ "dirname",
"directory",
- "base"
+ "base",
+ "wildcard"
],
+ "author": "Elan Shanker (https://github.com/es128)",
"license": "ISC",
- "main": "index.js",
- "maintainers": [
- {
- "name": "es128",
- "email": "elan.shanker+npm@gmail.com"
- }
- ],
- "name": "glob-parent",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/es128/glob-parent.git"
+ "bugs": {
+ "url": "https://github.com/es128/glob-parent/issues"
},
- "scripts": {
- "test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
+ "homepage": "https://github.com/es128/glob-parent",
+ "dependencies": {
+ "is-glob": "^3.1.0",
+ "path-dirname": "^1.0.0"
},
- "version": "2.0.0"
+ "devDependencies": {
+ "coveralls": "^2.11.2",
+ "istanbul": "^0.3.5",
+ "mocha": "^2.1.0"
+ }
}
diff --git a/node_modules/glob-parent/test.js b/node_modules/glob-parent/test.js
index 01156d2ff..6548261b3 100644
--- a/node_modules/glob-parent/test.js
+++ b/node_modules/glob-parent/test.js
@@ -5,24 +5,119 @@ var assert = require('assert');
describe('glob-parent', function() {
it('should strip glob magic to return parent path', function() {
- assert.equal(gp('path/to/*.js'), 'path/to');
- assert.equal(gp('/root/path/to/*.js'), '/root/path/to');
+ assert.equal(gp('.'), '.');
+ assert.equal(gp('.*'), '.');
+ assert.equal(gp('/.*'), '/');
+ assert.equal(gp('/.*/'), '/');
+ assert.equal(gp('a/.*/b'), 'a');
+ assert.equal(gp('a*/.*/b'), '.');
+ assert.equal(gp('*/a/b/c'), '.');
+ assert.equal(gp('*'), '.');
+ assert.equal(gp('*/'), '.');
+ assert.equal(gp('*/*'), '.');
+ assert.equal(gp('*/*/'), '.');
+ assert.equal(gp('**'), '.');
+ assert.equal(gp('**/'), '.');
+ assert.equal(gp('**/*'), '.');
+ assert.equal(gp('**/*/'), '.');
assert.equal(gp('/*.js'), '/');
assert.equal(gp('*.js'), '.');
assert.equal(gp('**/*.js'), '.');
+ assert.equal(gp('{a,b}'), '.');
+ assert.equal(gp('/{a,b}'), '/');
+ assert.equal(gp('/{a,b}/'), '/');
+ assert.equal(gp('(a|b)'), '.');
+ assert.equal(gp('/(a|b)'), '/');
+ assert.equal(gp('./(a|b)'), '.');
+ assert.equal(gp('a/(b c)'), 'a', 'not an extglob');
+ assert.equal(gp('a/(b c)/d'), 'a/(b c)', 'not an extglob');
+ assert.equal(gp('path/to/*.js'), 'path/to');
+ assert.equal(gp('/root/path/to/*.js'), '/root/path/to');
+ assert.equal(gp('chapter/foo [bar]/'), 'chapter');
+ assert.equal(gp('path/[a-z]'), 'path');
assert.equal(gp('path/{to,from}'), 'path');
+ assert.equal(gp('path/(to|from)'), 'path');
+ assert.equal(gp('path/(foo bar)/subdir/foo.*'), 'path/(foo bar)/subdir');
assert.equal(gp('path/!(to|from)'), 'path');
assert.equal(gp('path/?(to|from)'), 'path');
assert.equal(gp('path/+(to|from)'), 'path');
assert.equal(gp('path/*(to|from)'), 'path');
assert.equal(gp('path/@(to|from)'), 'path');
+ assert.equal(gp('path/!/foo'), 'path/!');
+ assert.equal(gp('path/?/foo'), 'path', 'qmarks must be escaped');
+ assert.equal(gp('path/+/foo'), 'path/+');
+ assert.equal(gp('path/*/foo'), 'path');
+ assert.equal(gp('path/@/foo'), 'path/@');
+ assert.equal(gp('path/!/foo/'), 'path/!/foo');
+ assert.equal(gp('path/?/foo/'), 'path', 'qmarks must be escaped');
+ assert.equal(gp('path/+/foo/'), 'path/+/foo');
+ assert.equal(gp('path/*/foo/'), 'path');
+ assert.equal(gp('path/@/foo/'), 'path/@/foo');
assert.equal(gp('path/**/*'), 'path');
assert.equal(gp('path/**/subdir/foo.*'), 'path');
+ assert.equal(gp('path/subdir/**/foo.js'), 'path/subdir');
+ assert.equal(gp('path/!subdir/foo.js'), 'path/!subdir');
+ });
+
+ it('should respect escaped characters', function() {
+ assert.equal(gp('path/\\*\\*/subdir/foo.*'), 'path/**/subdir');
+ assert.equal(gp('path/\\[\\*\\]/subdir/foo.*'), 'path/[*]/subdir');
+ assert.equal(gp('path/\\*(a|b)/subdir/foo.*'), 'path');
+ assert.equal(gp('path/\\*/(a|b)/subdir/foo.*'), 'path/*');
+ assert.equal(gp('path/\\*\\(a\\|b\\)/subdir/foo.*'), 'path/*(a|b)/subdir');
+ assert.equal(gp('path/\\[foo bar\\]/subdir/foo.*'), 'path/[foo bar]/subdir');
+ assert.equal(gp('path/\\[bar]/'), 'path/[bar]');
+ assert.equal(gp('path/foo \\[bar]/'), 'path/foo [bar]');
});
it('should return parent dirname from non-glob paths', function() {
- assert.equal(gp('path/foo/bar.js'), 'path/foo');
- assert.equal(gp('path/foo/'), 'path/foo');
+ assert.equal(gp('path'), '.');
assert.equal(gp('path/foo'), 'path');
+ assert.equal(gp('path/foo/'), 'path/foo');
+ assert.equal(gp('path/foo/bar.js'), 'path/foo');
+ });
+});
+
+describe('glob2base test patterns', function() {
+ it('should get a base name', function() {
+ assert.equal(gp('js/*.js'), 'js');
+ });
+
+ it('should get a base name from a nested glob', function() {
+ assert.equal(gp('js/**/test/*.js'), 'js');
+ });
+
+ it('should get a base name from a flat file', function() {
+ assert.equal(gp('js/test/wow.js'), 'js/test');
+ assert.equal(gp('js/test/wow.js'), 'js/test');
+ });
+
+ it('should get a base name from character class pattern', function() {
+ assert.equal(gp('js/t[a-z]st}/*.js'), 'js');
+ });
+
+ it('should get a base name from brace , expansion', function() {
+ assert.equal(gp('js/{src,test}/*.js'), 'js');
+ });
+
+ it('should get a base name from brace .. expansion', function() {
+ assert.equal(gp('js/test{0..9}/*.js'), 'js');
+ });
+
+ it('should get a base name from extglob', function() {
+ assert.equal(gp('js/t+(wo|est)/*.js'), 'js');
+ });
+
+ it('should get a base name from a path with non-exglob parens', function() {
+ assert.equal(gp('js/t(wo|est)/*.js'), 'js');
+ assert.equal(gp('js/t/(wo|est)/*.js'), 'js/t');
+ });
+
+ it('should get a base name from a complex brace glob', function() {
+ assert.equal(gp('lib/{components,pages}/**/{test,another}/*.txt'), 'lib');
+
+ assert.equal(gp('js/test/**/{images,components}/*.js'), 'js/test');
+
+ assert.equal(gp('ooga/{booga,sooga}/**/dooga/{eooga,fooga}'), 'ooga');
});
});