aboutsummaryrefslogtreecommitdiff
path: root/node_modules/glob-base
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/glob-base')
-rw-r--r--node_modules/glob-base/LICENSE21
-rw-r--r--node_modules/glob-base/README.md158
-rw-r--r--node_modules/glob-base/index.js51
-rw-r--r--node_modules/glob-base/node_modules/glob-parent/.npmignore4
-rw-r--r--node_modules/glob-base/node_modules/glob-parent/.travis.yml8
-rw-r--r--node_modules/glob-base/node_modules/glob-parent/LICENSE15
-rw-r--r--node_modules/glob-base/node_modules/glob-parent/README.md43
-rw-r--r--node_modules/glob-base/node_modules/glob-parent/index.js10
-rw-r--r--node_modules/glob-base/node_modules/glob-parent/package.json35
-rw-r--r--node_modules/glob-base/node_modules/glob-parent/test.js28
-rw-r--r--node_modules/glob-base/package.json52
11 files changed, 425 insertions, 0 deletions
diff --git a/node_modules/glob-base/LICENSE b/node_modules/glob-base/LICENSE
new file mode 100644
index 000000000..65f90aca8
--- /dev/null
+++ b/node_modules/glob-base/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, 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-base/README.md b/node_modules/glob-base/README.md
new file mode 100644
index 000000000..1da2e82f1
--- /dev/null
+++ b/node_modules/glob-base/README.md
@@ -0,0 +1,158 @@
+# glob-base [![NPM version](https://badge.fury.io/js/glob-base.svg)](http://badge.fury.io/js/glob-base) [![Build Status](https://travis-ci.org/jonschlinkert/glob-base.svg)](https://travis-ci.org/jonschlinkert/glob-base)
+
+> Returns an object with the (non-glob) base path and the actual pattern.
+
+Use [glob-parent](https://github.com/es128/glob-parent) if you just want the base path.
+
+## Install with [npm](npmjs.org)
+
+```bash
+npm i glob-base --save
+```
+
+## Related projects
+* [glob-parent](https://github.com/es128/glob-parent): Strips glob magic from a string to provide the parent path
+* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks.
+* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens.
+* [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern.
+* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.
+* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.
+* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.
+
+## Usage
+
+```js
+var globBase = require('glob-base');
+
+globBase('a/b/.git/');
+//=> { base: 'a/b/.git/', isGlob: false, glob: '' })
+
+globBase('a/b/**/e');
+//=> { base: 'a/b', isGlob: true, glob: '**/e' }
+
+globBase('a/b/*.{foo,bar}');
+//=> { base: 'a/b', isGlob: true, glob: '*.{foo,bar}' }
+
+globBase('a/b/.git/**');
+//=> { base: 'a/b/.git', isGlob: true, glob: '**' }
+
+globBase('a/b/c/*.md');
+//=> { base: 'a/b/c', isGlob: true, glob: '*.md' }
+
+globBase('a/b/c/.*.md');
+//=> { base: 'a/b/c', isGlob: true, glob: '.*.md' }
+
+globBase('a/b/{c,d}');
+//=> { base: 'a/b', isGlob: true, glob: '{c,d}' }
+
+globBase('!*.min.js');
+//=> { base: '.', isGlob: true, glob: '!*.min.js' }
+
+globBase('!foo');
+//=> { base: '.', isGlob: true, glob: '!foo' }
+
+globBase('!foo/(a|b).min.js');
+//=> { base: '.', isGlob: true, glob: '!foo/(a|b).min.js' }
+
+globBase('');
+//=> { base: '.', isGlob: false, glob: '' }
+
+globBase('**/*.md');
+//=> { base: '.', isGlob: true, glob: '**/*.md' }
+
+globBase('**/*.min.js');
+//=> { base: '.', isGlob: true, glob: '**/*.min.js' }
+
+globBase('**/.*');
+//=> { base: '.', isGlob: true, glob: '**/.*' }
+
+globBase('**/d');
+//=> { base: '.', isGlob: true, glob: '**/d' }
+
+globBase('*.*');
+//=> { base: '.', isGlob: true, glob: '*.*' }
+
+globBase('*.min.js');
+//=> { base: '.', isGlob: true, glob: '*.min.js' }
+
+globBase('*/*');
+//=> { base: '.', isGlob: true, glob: '*/*' }
+
+globBase('*b');
+//=> { base: '.', isGlob: true, glob: '*b' }
+
+globBase('.');
+//=> { base: '.', isGlob: false, glob: '.' }
+
+globBase('.*');
+//=> { base: '.', isGlob: true, glob: '.*' }
+
+globBase('./*');
+//=> { base: '.', isGlob: true, glob: '*' }
+
+globBase('/a');
+//=> { base: '/', isGlob: false, glob: 'a' }
+
+globBase('@(a|b)/e.f.g/');
+//=> { base: '.', isGlob: true, glob: '@(a|b)/e.f.g/' }
+
+globBase('[a-c]b*');
+//=> { base: '.', isGlob: true, glob: '[a-c]b*' }
+
+globBase('a');
+//=> { base: '.', isGlob: false, glob: 'a' }
+
+globBase('a.min.js');
+//=> { base: '.', isGlob: false, glob: 'a.min.js' }
+
+globBase('a/');
+//=> { base: 'a/', isGlob: false, glob: '' }
+
+globBase('a/**/j/**/z/*.md');
+//=> { base: 'a', isGlob: true, glob: '**/j/**/z/*.md' }
+
+globBase('a/*/c/*.md');
+//=> { base: 'a', isGlob: true, glob: '*/c/*.md' }
+
+globBase('a/?/c.md');
+//=> { base: 'a', isGlob: true, glob: '?/c.md' }
+
+globBase('a/??/c.js');
+//=> { base: 'a', isGlob: true, glob: '??/c.js' }
+
+globBase('a?b');
+//=> { base: '.', isGlob: true, glob: 'a?b' }
+
+globBase('bb');
+//=> { base: '.', isGlob: false, glob: 'bb' }
+
+globBase('c.md');
+//=> { base: '.', isGlob: false, glob: 'c.md' }
+```
+
+## Running tests
+Install dev dependencies.
+
+```bash
+npm i -d && npm test
+```
+
+
+## Contributing
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/glob-base/issues)
+
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+Copyright (c) 2015 Jon Schlinkert
+Released under the MIT license
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 08, 2015._
diff --git a/node_modules/glob-base/index.js b/node_modules/glob-base/index.js
new file mode 100644
index 000000000..564b4a885
--- /dev/null
+++ b/node_modules/glob-base/index.js
@@ -0,0 +1,51 @@
+/*!
+ * glob-base <https://github.com/jonschlinkert/glob-base>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var path = require('path');
+var parent = require('glob-parent');
+var isGlob = require('is-glob');
+
+module.exports = function globBase(pattern) {
+ if (typeof pattern !== 'string') {
+ throw new TypeError('glob-base expects a string.');
+ }
+
+ var res = {};
+ res.base = parent(pattern);
+ res.isGlob = isGlob(pattern);
+
+ if (res.base !== '.') {
+ res.glob = pattern.substr(res.base.length);
+ if (res.glob.charAt(0) === '/') {
+ res.glob = res.glob.substr(1);
+ }
+ } else {
+ res.glob = pattern;
+ }
+
+ if (!res.isGlob) {
+ res.base = dirname(pattern);
+ res.glob = res.base !== '.'
+ ? pattern.substr(res.base.length)
+ : pattern;
+ }
+
+ if (res.glob.substr(0, 2) === './') {
+ res.glob = res.glob.substr(2);
+ }
+ if (res.glob.charAt(0) === '/') {
+ res.glob = res.glob.substr(1);
+ }
+ return res;
+};
+
+function dirname(glob) {
+ if (glob.slice(-1) === '/') return glob;
+ return path.dirname(glob);
+}
diff --git a/node_modules/glob-base/node_modules/glob-parent/.npmignore b/node_modules/glob-base/node_modules/glob-parent/.npmignore
new file mode 100644
index 000000000..33e391f0e
--- /dev/null
+++ b/node_modules/glob-base/node_modules/glob-parent/.npmignore
@@ -0,0 +1,4 @@
+node_modules
+.DS_Store
+npm-debug.log
+coverage
diff --git a/node_modules/glob-base/node_modules/glob-parent/.travis.yml b/node_modules/glob-base/node_modules/glob-parent/.travis.yml
new file mode 100644
index 000000000..18fc42f69
--- /dev/null
+++ b/node_modules/glob-base/node_modules/glob-parent/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+ - "4"
+ - "iojs-v3"
+ - "iojs-v2"
+ - "iojs-v1"
+ - "0.12"
+ - "0.10"
diff --git a/node_modules/glob-base/node_modules/glob-parent/LICENSE b/node_modules/glob-base/node_modules/glob-parent/LICENSE
new file mode 100644
index 000000000..734076d8a
--- /dev/null
+++ b/node_modules/glob-base/node_modules/glob-parent/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) 2015 Elan Shanker
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/glob-base/node_modules/glob-parent/README.md b/node_modules/glob-base/node_modules/glob-parent/README.md
new file mode 100644
index 000000000..ff5310d3b
--- /dev/null
+++ b/node_modules/glob-base/node_modules/glob-parent/README.md
@@ -0,0 +1,43 @@
+glob-parent [![Build Status](https://travis-ci.org/es128/glob-parent.svg)](https://travis-ci.org/es128/glob-parent) [![Coverage Status](https://img.shields.io/coveralls/es128/glob-parent.svg)](https://coveralls.io/r/es128/glob-parent?branch=master)
+======
+Javascript module to extract the non-magic parent path from a glob string.
+
+[![NPM](https://nodei.co/npm/glob-parent.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/glob-parent/)
+[![NPM](https://nodei.co/npm-dl/glob-parent.png?height=3&months=9)](https://nodei.co/npm-dl/glob-parent/)
+
+Usage
+-----
+```sh
+npm install glob-parent --save
+```
+
+```js
+var globParent = require('glob-parent');
+
+globParent('path/to/*.js'); // 'path/to'
+globParent('/root/path/to/*.js'); // '/root/path/to'
+globParent('/*.js'); // '/'
+globParent('*.js'); // '.'
+globParent('**/*.js'); // '.'
+globParent('path/{to,from}'); // 'path'
+globParent('path/!(to|from)'); // 'path'
+globParent('path/?(to|from)'); // 'path'
+globParent('path/+(to|from)'); // 'path'
+globParent('path/*(to|from)'); // 'path'
+globParent('path/@(to|from)'); // 'path'
+globParent('path/**/*'); // 'path'
+
+// if provided a non-glob path, returns the nearest dir
+globParent('path/foo/bar.js'); // 'path/foo'
+globParent('path/foo/'); // 'path/foo'
+globParent('path/foo'); // 'path' (see issue #3 for details)
+
+```
+
+Change Log
+----------
+[See release notes page on GitHub](https://github.com/es128/glob-parent/releases)
+
+License
+-------
+[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE)
diff --git a/node_modules/glob-base/node_modules/glob-parent/index.js b/node_modules/glob-base/node_modules/glob-parent/index.js
new file mode 100644
index 000000000..61615f1ac
--- /dev/null
+++ b/node_modules/glob-base/node_modules/glob-parent/index.js
@@ -0,0 +1,10 @@
+'use strict';
+
+var path = require('path');
+var isglob = require('is-glob');
+
+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;
+};
diff --git a/node_modules/glob-base/node_modules/glob-parent/package.json b/node_modules/glob-base/node_modules/glob-parent/package.json
new file mode 100644
index 000000000..5499007fb
--- /dev/null
+++ b/node_modules/glob-base/node_modules/glob-parent/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "glob-parent",
+ "version": "2.0.0",
+ "description": "Strips glob magic from a string to provide the parent path",
+ "main": "index.js",
+ "scripts": {
+ "test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/es128/glob-parent"
+ },
+ "keywords": [
+ "glob",
+ "parent",
+ "strip",
+ "path",
+ "directory",
+ "base"
+ ],
+ "author": "Elan Shanker",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/es128/glob-parent/issues"
+ },
+ "homepage": "https://github.com/es128/glob-parent",
+ "dependencies": {
+ "is-glob": "^2.0.0"
+ },
+ "devDependencies": {
+ "coveralls": "^2.11.2",
+ "istanbul": "^0.3.5",
+ "mocha": "^2.1.0"
+ }
+}
diff --git a/node_modules/glob-base/node_modules/glob-parent/test.js b/node_modules/glob-base/node_modules/glob-parent/test.js
new file mode 100644
index 000000000..01156d2ff
--- /dev/null
+++ b/node_modules/glob-base/node_modules/glob-parent/test.js
@@ -0,0 +1,28 @@
+'use strict';
+
+var gp = require('./');
+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('/*.js'), '/');
+ assert.equal(gp('*.js'), '.');
+ assert.equal(gp('**/*.js'), '.');
+ 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/@(to|from)'), 'path');
+ assert.equal(gp('path/**/*'), 'path');
+ assert.equal(gp('path/**/subdir/foo.*'), 'path');
+ });
+
+ 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/foo'), 'path');
+ });
+});
diff --git a/node_modules/glob-base/package.json b/node_modules/glob-base/package.json
new file mode 100644
index 000000000..8cb2dbf5e
--- /dev/null
+++ b/node_modules/glob-base/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "glob-base",
+ "description": "Returns an object with the (non-glob) base path and the actual pattern.",
+ "version": "0.3.0",
+ "homepage": "https://github.com/jonschlinkert/glob-base",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jonschlinkert/glob-base.git"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/glob-base/issues"
+ },
+ "license": {
+ "type": "MIT",
+ "url": "https://github.com/jonschlinkert/glob-base/blob/master/LICENSE"
+ },
+ "files": [
+ "index.js"
+ ],
+ "main": "index.js",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "dependencies": {
+ "glob-parent": "^2.0.0",
+ "is-glob": "^2.0.0"
+ },
+ "devDependencies": {
+ "mocha": "*",
+ "should": "^5.1.0"
+ },
+ "keywords": [
+ "base",
+ "directory",
+ "dirname",
+ "expression",
+ "glob",
+ "parent",
+ "path",
+ "pattern",
+ "regex",
+ "regular",
+ "root"
+ ]
+}