ubdate
This commit is contained in:
21
node_modules/glob-stream/LICENSE
generated
vendored
Executable file
21
node_modules/glob-stream/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2017 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
|
||||
|
||||
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.
|
||||
146
node_modules/glob-stream/README.md
generated
vendored
Normal file
146
node_modules/glob-stream/README.md
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
<p align="center">
|
||||
<a href="http://gulpjs.com">
|
||||
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# glob-stream
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
|
||||
|
||||
A [Readable Stream][readable-stream-url] interface over [node-glob][node-glob-url].
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var gs = require('glob-stream');
|
||||
|
||||
var readable = gs('./files/**/*.coffee', { /* options */ });
|
||||
|
||||
var writable = /* your WriteableStream */
|
||||
|
||||
readable.pipe(writable);
|
||||
```
|
||||
|
||||
You can pass any combination of glob strings. One caveat is that you cannot __only__ pass a negative glob, you must give it at least one positive glob so it knows where to start. If given a non-glob path (also referred to as a singular glob), only one file will be emitted. If given a singular glob and no files match, an error is emitted (see also [`options.allowEmpty`][allow-empty-url]).
|
||||
|
||||
## API
|
||||
|
||||
### `globStream(globs, options)`
|
||||
|
||||
Takes a glob string or an array of glob strings as the first argument and an options object as the second. Returns a stream of objects that contain `cwd`, `base` and `path` properties.
|
||||
|
||||
#### Options
|
||||
|
||||
##### `options.allowEmpty`
|
||||
|
||||
Whether or not to error upon an empty singular glob.
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `false` (error upon no match)
|
||||
|
||||
##### `options.dot`
|
||||
|
||||
Whether or not to treat dotfiles as regular files. This is passed through to [node-glob][node-glob-url].
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `false`
|
||||
|
||||
##### `options.silent`
|
||||
|
||||
Whether or not to suppress warnings on stderr from [node-glob][node-glob-url]. This is passed through to [node-glob][node-glob-url].
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `true`
|
||||
|
||||
##### `options.cwd`
|
||||
|
||||
The current working directory that the glob is resolved against.
|
||||
|
||||
Type: `String`
|
||||
|
||||
Default: `process.cwd()`
|
||||
|
||||
##### `options.root`
|
||||
|
||||
The root path that the glob is resolved against.
|
||||
|
||||
__Note: This is never passed to [node-glob][node-glob-url] because it is pre-resolved against your paths.__
|
||||
|
||||
Type: `String`
|
||||
|
||||
Default: `undefined` (use the filesystem root)
|
||||
|
||||
##### `options.base`
|
||||
|
||||
The absolute segment of the glob path that isn't a glob. This value is attached to each glob object and is useful for relative pathing.
|
||||
|
||||
Type: `String`
|
||||
|
||||
Default: The absolute path segement before a glob starts (see [glob-parent][glob-parent-url])
|
||||
|
||||
##### `options.cwdbase`
|
||||
|
||||
Whether or not the `cwd` and `base` should be the same.
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `false`
|
||||
|
||||
##### `options.uniqueBy`
|
||||
|
||||
Filters stream to remove duplicates based on the string property name or the result of function. When using a function, the function receives the streamed data (objects containing `cwd`, `base`, `path` properties) to compare against.
|
||||
|
||||
Type: `String` or `Function`
|
||||
|
||||
Default: `'path'`
|
||||
|
||||
##### other
|
||||
|
||||
Any glob-related options are documented in [node-glob][node-glob-url]. Those options are forwarded verbatim, with the exception of `root` and `ignore`. `root` is pre-resolved and `ignore` is joined with all negative globs.
|
||||
|
||||
#### Globbing & Negation
|
||||
|
||||
```js
|
||||
var stream = gs(['./**/*.js', '!./node_modules/**/*']);
|
||||
```
|
||||
|
||||
Globs are executed in order, so negations should follow positive globs. For example:
|
||||
|
||||
The following would __not__ exclude any files:
|
||||
```js
|
||||
gs(['!b*.js', '*.js'])
|
||||
```
|
||||
|
||||
However, this would exclude all files that started with `b`:
|
||||
```js
|
||||
gs(['*.js', '!b*.js'])
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[node-glob-url]: https://github.com/isaacs/node-glob
|
||||
[glob-parent-url]: https://github.com/es128/glob-parent
|
||||
[allow-empty-url]: #optionsallowempty
|
||||
[readable-stream-url]: https://nodejs.org/api/stream.html#stream_readable_streams
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/glob-stream.svg
|
||||
[npm-url]: https://www.npmjs.com/package/glob-stream
|
||||
[npm-image]: http://img.shields.io/npm/v/glob-stream.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulpjs/glob-stream
|
||||
[travis-image]: http://img.shields.io/travis/gulpjs/glob-stream.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-stream
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-stream.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/glob-stream
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glob-stream.svg
|
||||
|
||||
[gitter-url]: https://gitter.im/gulpjs/gulp
|
||||
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
|
||||
94
node_modules/glob-stream/index.js
generated
vendored
Normal file
94
node_modules/glob-stream/index.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
'use strict';
|
||||
|
||||
var Combine = require('ordered-read-streams');
|
||||
var unique = require('unique-stream');
|
||||
var pumpify = require('pumpify');
|
||||
var isNegatedGlob = require('is-negated-glob');
|
||||
var extend = require('extend');
|
||||
|
||||
var GlobStream = require('./readable');
|
||||
|
||||
function globStream(globs, opt) {
|
||||
if (!opt) {
|
||||
opt = {};
|
||||
}
|
||||
|
||||
var ourOpt = extend({}, opt);
|
||||
var ignore = ourOpt.ignore;
|
||||
|
||||
ourOpt.cwd = typeof ourOpt.cwd === 'string' ? ourOpt.cwd : process.cwd();
|
||||
ourOpt.dot = typeof ourOpt.dot === 'boolean' ? ourOpt.dot : false;
|
||||
ourOpt.silent = typeof ourOpt.silent === 'boolean' ? ourOpt.silent : true;
|
||||
ourOpt.cwdbase = typeof ourOpt.cwdbase === 'boolean' ? ourOpt.cwdbase : false;
|
||||
ourOpt.uniqueBy = typeof ourOpt.uniqueBy === 'string' ||
|
||||
typeof ourOpt.uniqueBy === 'function' ? ourOpt.uniqueBy : 'path';
|
||||
|
||||
if (ourOpt.cwdbase) {
|
||||
ourOpt.base = ourOpt.cwd;
|
||||
}
|
||||
// Normalize string `ignore` to array
|
||||
if (typeof ignore === 'string') {
|
||||
ignore = [ignore];
|
||||
}
|
||||
// Ensure `ignore` is an array
|
||||
if (!Array.isArray(ignore)) {
|
||||
ignore = [];
|
||||
}
|
||||
|
||||
// Only one glob no need to aggregate
|
||||
if (!Array.isArray(globs)) {
|
||||
globs = [globs];
|
||||
}
|
||||
|
||||
var positives = [];
|
||||
var negatives = [];
|
||||
|
||||
globs.forEach(sortGlobs);
|
||||
|
||||
function sortGlobs(globString, index) {
|
||||
if (typeof globString !== 'string') {
|
||||
throw new Error('Invalid glob at index ' + index);
|
||||
}
|
||||
|
||||
var glob = isNegatedGlob(globString);
|
||||
var globArray = glob.negated ? negatives : positives;
|
||||
|
||||
globArray.push({
|
||||
index: index,
|
||||
glob: glob.pattern,
|
||||
});
|
||||
}
|
||||
|
||||
if (positives.length === 0) {
|
||||
throw new Error('Missing positive glob');
|
||||
}
|
||||
|
||||
// Create all individual streams
|
||||
var streams = positives.map(streamFromPositive);
|
||||
|
||||
// Then just pipe them to a single unique stream and return it
|
||||
var aggregate = new Combine(streams);
|
||||
var uniqueStream = unique(ourOpt.uniqueBy);
|
||||
|
||||
return pumpify.obj(aggregate, uniqueStream);
|
||||
|
||||
function streamFromPositive(positive) {
|
||||
var negativeGlobs = negatives
|
||||
.filter(indexGreaterThan(positive.index))
|
||||
.map(toGlob)
|
||||
.concat(ignore);
|
||||
return new GlobStream(positive.glob, negativeGlobs, ourOpt);
|
||||
}
|
||||
}
|
||||
|
||||
function indexGreaterThan(index) {
|
||||
return function(obj) {
|
||||
return obj.index > index;
|
||||
};
|
||||
}
|
||||
|
||||
function toGlob(obj) {
|
||||
return obj.glob;
|
||||
}
|
||||
|
||||
module.exports = globStream;
|
||||
15
node_modules/glob-stream/node_modules/glob-parent/LICENSE
generated
vendored
Normal file
15
node_modules/glob-stream/node_modules/glob-parent/LICENSE
generated
vendored
Normal file
@@ -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.
|
||||
109
node_modules/glob-stream/node_modules/glob-parent/README.md
generated
vendored
Normal file
109
node_modules/glob-stream/node_modules/glob-parent/README.md
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
glob-parent [](https://travis-ci.org/es128/glob-parent) [](https://coveralls.io/r/es128/glob-parent?branch=master)
|
||||
======
|
||||
Javascript module to extract the non-magic parent path from a glob string.
|
||||
|
||||
[](https://nodei.co/npm/glob-parent/)
|
||||
[](https://nodei.co/npm-dl/glob-parent/)
|
||||
|
||||
Usage
|
||||
-----
|
||||
```sh
|
||||
npm install glob-parent --save
|
||||
```
|
||||
|
||||
**Examples**
|
||||
|
||||
```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)
|
||||
```
|
||||
|
||||
## 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]'
|
||||
```
|
||||
|
||||
## Limitations
|
||||
|
||||
#### Braces & Brackets
|
||||
This library attempts a quick and imperfect method of determining which path
|
||||
parts have glob magic without fully parsing/lexing the pattern. There are some
|
||||
advanced use cases that can trip it up, such as nested braces where the outer
|
||||
pair is escaped and the inner one contains a path separator. If you find
|
||||
yourself in the unlikely circumstance of being affected by this or need to
|
||||
ensure higher-fidelity glob handling in your library, it is recommended that you
|
||||
pre-process your input with [expand-braces] and/or [expand-brackets].
|
||||
|
||||
#### Windows
|
||||
Backslashes are not valid path separators for globs. If a path with backslashes
|
||||
is provided anyway, for simple cases, glob-parent will replace the path
|
||||
separator for you and return the non-glob parent path (now with
|
||||
forward-slashes, which are still valid as Windows path separators).
|
||||
|
||||
This cannot be used in conjunction with escape characters.
|
||||
|
||||
```js
|
||||
// BAD
|
||||
globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)'
|
||||
|
||||
// GOOD
|
||||
globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)'
|
||||
```
|
||||
|
||||
If you are using escape characters for a pattern without path parts (i.e.
|
||||
relative to `cwd`), prefix with `./` to avoid confusing glob-parent.
|
||||
|
||||
```js
|
||||
// BAD
|
||||
globParent('foo \\[bar]') // 'foo '
|
||||
globParent('foo \\[bar]*') // 'foo '
|
||||
|
||||
// GOOD
|
||||
globParent('./foo \\[bar]') // 'foo [bar]'
|
||||
globParent('./foo \\[bar]*') // '.'
|
||||
```
|
||||
|
||||
|
||||
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)
|
||||
|
||||
[expand-braces]: https://github.com/jonschlinkert/expand-braces
|
||||
[expand-brackets]: https://github.com/jonschlinkert/expand-brackets
|
||||
24
node_modules/glob-stream/node_modules/glob-parent/index.js
generated
vendored
Normal file
24
node_modules/glob-stream/node_modules/glob-parent/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var isglob = require('is-glob');
|
||||
var pathDirname = require('path-dirname');
|
||||
var isWin32 = require('os').platform() === 'win32';
|
||||
|
||||
module.exports = function globParent(str) {
|
||||
// flip windows path separators
|
||||
if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/');
|
||||
|
||||
// special case for strings ending in enclosure containing path separator
|
||||
if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/';
|
||||
|
||||
// preserves full path in case of trailing path separator
|
||||
str += 'a';
|
||||
|
||||
// remove path parts that are globby
|
||||
do {str = pathDirname.posix(str)}
|
||||
while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str));
|
||||
|
||||
// remove escape chars and return result
|
||||
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
|
||||
};
|
||||
42
node_modules/glob-stream/node_modules/glob-parent/package.json
generated
vendored
Normal file
42
node_modules/glob-stream/node_modules/glob-parent/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "glob-parent",
|
||||
"version": "3.1.0",
|
||||
"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"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/es128/glob-parent"
|
||||
},
|
||||
"keywords": [
|
||||
"glob",
|
||||
"parent",
|
||||
"strip",
|
||||
"path",
|
||||
"dirname",
|
||||
"directory",
|
||||
"base",
|
||||
"wildcard"
|
||||
],
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"author": "Elan Shanker (https://github.com/es128)",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/es128/glob-parent/issues"
|
||||
},
|
||||
"homepage": "https://github.com/es128/glob-parent",
|
||||
"dependencies": {
|
||||
"is-glob": "^3.1.0",
|
||||
"path-dirname": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.2",
|
||||
"istanbul": "^0.3.5",
|
||||
"mocha": "^2.1.0"
|
||||
}
|
||||
}
|
||||
21
node_modules/glob-stream/node_modules/is-glob/LICENSE
generated
vendored
Normal file
21
node_modules/glob-stream/node_modules/is-glob/LICENSE
generated
vendored
Normal file
@@ -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.
|
||||
142
node_modules/glob-stream/node_modules/is-glob/README.md
generated
vendored
Normal file
142
node_modules/glob-stream/node_modules/is-glob/README.md
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
# is-glob [](https://www.npmjs.com/package/is-glob) [](https://npmjs.org/package/is-glob) [](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._
|
||||
25
node_modules/glob-stream/node_modules/is-glob/index.js
generated
vendored
Normal file
25
node_modules/glob-stream/node_modules/is-glob/index.js
generated
vendored
Normal file
@@ -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;
|
||||
};
|
||||
80
node_modules/glob-stream/node_modules/is-glob/package.json
generated
vendored
Normal file
80
node_modules/glob-stream/node_modules/is-glob/package.json
generated
vendored
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
59
node_modules/glob-stream/package.json
generated
vendored
Normal file
59
node_modules/glob-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "glob-stream",
|
||||
"version": "6.1.0",
|
||||
"description": "A Readable Stream interface over node-glob.",
|
||||
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
|
||||
"contributors": [
|
||||
"Eric Schoffstall <yo@contra.io>",
|
||||
"Blaine Bublitz <blaine.bublitz@gmail.com>"
|
||||
],
|
||||
"repository": "gulpjs/glob-stream",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"readable.js",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint . && jscs index.js readable.js test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha --async-only",
|
||||
"cover": "istanbul cover _mocha --report lcovonly",
|
||||
"coveralls": "npm run cover && istanbul-coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"extend": "^3.0.0",
|
||||
"glob": "^7.1.1",
|
||||
"glob-parent": "^3.1.0",
|
||||
"is-negated-glob": "^1.0.0",
|
||||
"ordered-read-streams": "^1.0.0",
|
||||
"pumpify": "^1.3.5",
|
||||
"readable-stream": "^2.1.5",
|
||||
"remove-trailing-separator": "^1.0.1",
|
||||
"to-absolute-glob": "^2.0.0",
|
||||
"unique-stream": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^1.10.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"expect": "^1.19.0",
|
||||
"istanbul": "^0.4.3",
|
||||
"istanbul-coveralls": "^1.0.3",
|
||||
"jscs": "^2.4.0",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mississippi": "^1.2.0",
|
||||
"mocha": "^2.4.5"
|
||||
},
|
||||
"keywords": [
|
||||
"glob",
|
||||
"stream",
|
||||
"gulp",
|
||||
"readable",
|
||||
"fs",
|
||||
"files"
|
||||
]
|
||||
}
|
||||
117
node_modules/glob-stream/readable.js
generated
vendored
Normal file
117
node_modules/glob-stream/readable.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
'use strict';
|
||||
|
||||
var inherits = require('util').inherits;
|
||||
|
||||
var glob = require('glob');
|
||||
var extend = require('extend');
|
||||
var Readable = require('readable-stream').Readable;
|
||||
var globParent = require('glob-parent');
|
||||
var toAbsoluteGlob = require('to-absolute-glob');
|
||||
var removeTrailingSeparator = require('remove-trailing-separator');
|
||||
|
||||
var globErrMessage1 = 'File not found with singular glob: ';
|
||||
var globErrMessage2 = ' (if this was purposeful, use `allowEmpty` option)';
|
||||
|
||||
function getBasePath(ourGlob, opt) {
|
||||
return globParent(toAbsoluteGlob(ourGlob, opt));
|
||||
}
|
||||
|
||||
function globIsSingular(glob) {
|
||||
var globSet = glob.minimatch.set;
|
||||
if (globSet.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return globSet[0].every(function isString(value) {
|
||||
return typeof value === 'string';
|
||||
});
|
||||
}
|
||||
|
||||
function GlobStream(ourGlob, negatives, opt) {
|
||||
if (!(this instanceof GlobStream)) {
|
||||
return new GlobStream(ourGlob, negatives, opt);
|
||||
}
|
||||
|
||||
var ourOpt = extend({}, opt);
|
||||
|
||||
Readable.call(this, {
|
||||
objectMode: true,
|
||||
highWaterMark: ourOpt.highWaterMark || 16,
|
||||
});
|
||||
|
||||
// Delete `highWaterMark` after inheriting from Readable
|
||||
delete ourOpt.highWaterMark;
|
||||
|
||||
var self = this;
|
||||
|
||||
function resolveNegatives(negative) {
|
||||
return toAbsoluteGlob(negative, ourOpt);
|
||||
}
|
||||
|
||||
var ourNegatives = negatives.map(resolveNegatives);
|
||||
ourOpt.ignore = ourNegatives;
|
||||
|
||||
var cwd = ourOpt.cwd;
|
||||
var allowEmpty = ourOpt.allowEmpty || false;
|
||||
|
||||
// Extract base path from glob
|
||||
var basePath = ourOpt.base || getBasePath(ourGlob, ourOpt);
|
||||
|
||||
// Remove path relativity to make globs make sense
|
||||
ourGlob = toAbsoluteGlob(ourGlob, ourOpt);
|
||||
// Delete `root` after all resolving done
|
||||
delete ourOpt.root;
|
||||
|
||||
var globber = new glob.Glob(ourGlob, ourOpt);
|
||||
this._globber = globber;
|
||||
|
||||
var found = false;
|
||||
|
||||
globber.on('match', function(filepath) {
|
||||
found = true;
|
||||
var obj = {
|
||||
cwd: cwd,
|
||||
base: basePath,
|
||||
path: removeTrailingSeparator(filepath),
|
||||
};
|
||||
if (!self.push(obj)) {
|
||||
globber.pause();
|
||||
}
|
||||
});
|
||||
|
||||
globber.once('end', function() {
|
||||
if (allowEmpty !== true && !found && globIsSingular(globber)) {
|
||||
var err = new Error(globErrMessage1 + ourGlob + globErrMessage2);
|
||||
|
||||
return self.destroy(err);
|
||||
}
|
||||
|
||||
self.push(null);
|
||||
});
|
||||
|
||||
function onError(err) {
|
||||
self.destroy(err);
|
||||
}
|
||||
|
||||
globber.once('error', onError);
|
||||
}
|
||||
inherits(GlobStream, Readable);
|
||||
|
||||
GlobStream.prototype._read = function() {
|
||||
this._globber.resume();
|
||||
};
|
||||
|
||||
GlobStream.prototype.destroy = function(err) {
|
||||
var self = this;
|
||||
|
||||
this._globber.abort();
|
||||
|
||||
process.nextTick(function() {
|
||||
if (err) {
|
||||
self.emit('error', err);
|
||||
}
|
||||
self.emit('close');
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = GlobStream;
|
||||
Reference in New Issue
Block a user