Added game info bar
This commit is contained in:
1
node_modules/minimatch/.npmignore
generated
vendored
Normal file
1
node_modules/minimatch/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
23
node_modules/minimatch/LICENSE
generated
vendored
Normal file
23
node_modules/minimatch/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
|
||||
All rights reserved.
|
||||
|
||||
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.
|
218
node_modules/minimatch/README.md
generated
vendored
Normal file
218
node_modules/minimatch/README.md
generated
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
# minimatch
|
||||
|
||||
A minimal matching utility.
|
||||
|
||||
[](http://travis-ci.org/isaacs/minimatch)
|
||||
|
||||
|
||||
This is the matching library used internally by npm.
|
||||
|
||||
Eventually, it will replace the C binding in node-glob.
|
||||
|
||||
It works by converting glob expressions into JavaScript `RegExp`
|
||||
objects.
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var minimatch = require("minimatch")
|
||||
|
||||
minimatch("bar.foo", "*.foo") // true!
|
||||
minimatch("bar.foo", "*.bar") // false!
|
||||
minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy!
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
Supports these glob features:
|
||||
|
||||
* Brace Expansion
|
||||
* Extended glob matching
|
||||
* "Globstar" `**` matching
|
||||
|
||||
See:
|
||||
|
||||
* `man sh`
|
||||
* `man bash`
|
||||
* `man 3 fnmatch`
|
||||
* `man 5 gitignore`
|
||||
|
||||
## Minimatch Class
|
||||
|
||||
Create a minimatch object by instanting the `minimatch.Minimatch` class.
|
||||
|
||||
```javascript
|
||||
var Minimatch = require("minimatch").Minimatch
|
||||
var mm = new Minimatch(pattern, options)
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
* `pattern` The original pattern the minimatch object represents.
|
||||
* `options` The options supplied to the constructor.
|
||||
* `set` A 2-dimensional array of regexp or string expressions.
|
||||
Each row in the
|
||||
array corresponds to a brace-expanded pattern. Each item in the row
|
||||
corresponds to a single path-part. For example, the pattern
|
||||
`{a,b/c}/d` would expand to a set of patterns like:
|
||||
|
||||
[ [ a, d ]
|
||||
, [ b, c, d ] ]
|
||||
|
||||
If a portion of the pattern doesn't have any "magic" in it
|
||||
(that is, it's something like `"foo"` rather than `fo*o?`), then it
|
||||
will be left as a string rather than converted to a regular
|
||||
expression.
|
||||
|
||||
* `regexp` Created by the `makeRe` method. A single regular expression
|
||||
expressing the entire pattern. This is useful in cases where you wish
|
||||
to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
|
||||
* `negate` True if the pattern is negated.
|
||||
* `comment` True if the pattern is a comment.
|
||||
* `empty` True if the pattern is `""`.
|
||||
|
||||
### Methods
|
||||
|
||||
* `makeRe` Generate the `regexp` member if necessary, and return it.
|
||||
Will return `false` if the pattern is invalid.
|
||||
* `match(fname)` Return true if the filename matches the pattern, or
|
||||
false otherwise.
|
||||
* `matchOne(fileArray, patternArray, partial)` Take a `/`-split
|
||||
filename, and match it against a single row in the `regExpSet`. This
|
||||
method is mainly for internal use, but is exposed so that it can be
|
||||
used by a glob-walker that needs to avoid excessive filesystem calls.
|
||||
|
||||
All other methods are internal, and will be called as necessary.
|
||||
|
||||
## Functions
|
||||
|
||||
The top-level exported function has a `cache` property, which is an LRU
|
||||
cache set to store 100 items. So, calling these methods repeatedly
|
||||
with the same pattern and options will use the same Minimatch object,
|
||||
saving the cost of parsing it multiple times.
|
||||
|
||||
### minimatch(path, pattern, options)
|
||||
|
||||
Main export. Tests a path against the pattern using the options.
|
||||
|
||||
```javascript
|
||||
var isJS = minimatch(file, "*.js", { matchBase: true })
|
||||
```
|
||||
|
||||
### minimatch.filter(pattern, options)
|
||||
|
||||
Returns a function that tests its
|
||||
supplied argument, suitable for use with `Array.filter`. Example:
|
||||
|
||||
```javascript
|
||||
var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))
|
||||
```
|
||||
|
||||
### minimatch.match(list, pattern, options)
|
||||
|
||||
Match against the list of
|
||||
files, in the style of fnmatch or glob. If nothing is matched, and
|
||||
options.nonull is set, then return a list containing the pattern itself.
|
||||
|
||||
```javascript
|
||||
var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}))
|
||||
```
|
||||
|
||||
### minimatch.makeRe(pattern, options)
|
||||
|
||||
Make a regular expression object from the pattern.
|
||||
|
||||
## Options
|
||||
|
||||
All options are `false` by default.
|
||||
|
||||
### debug
|
||||
|
||||
Dump a ton of stuff to stderr.
|
||||
|
||||
### nobrace
|
||||
|
||||
Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
|
||||
### noglobstar
|
||||
|
||||
Disable `**` matching against multiple folder names.
|
||||
|
||||
### dot
|
||||
|
||||
Allow patterns to match filenames starting with a period, even if
|
||||
the pattern does not explicitly have a period in that spot.
|
||||
|
||||
Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
|
||||
is set.
|
||||
|
||||
### noext
|
||||
|
||||
Disable "extglob" style patterns like `+(a|b)`.
|
||||
|
||||
### nocase
|
||||
|
||||
Perform a case-insensitive match.
|
||||
|
||||
### nonull
|
||||
|
||||
When a match is not found by `minimatch.match`, return a list containing
|
||||
the pattern itself if this option is set. When not set, an empty list
|
||||
is returned if there are no matches.
|
||||
|
||||
### matchBase
|
||||
|
||||
If set, then patterns without slashes will be matched
|
||||
against the basename of the path if it contains slashes. For example,
|
||||
`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
|
||||
|
||||
### nocomment
|
||||
|
||||
Suppress the behavior of treating `#` at the start of a pattern as a
|
||||
comment.
|
||||
|
||||
### nonegate
|
||||
|
||||
Suppress the behavior of treating a leading `!` character as negation.
|
||||
|
||||
### flipNegate
|
||||
|
||||
Returns from negate expressions the same as if they were not negated.
|
||||
(Ie, true on a hit, false on a miss.)
|
||||
|
||||
|
||||
## Comparisons to other fnmatch/glob implementations
|
||||
|
||||
While strict compliance with the existing standards is a worthwhile
|
||||
goal, some discrepancies exist between minimatch and other
|
||||
implementations, and are intentional.
|
||||
|
||||
If the pattern starts with a `!` character, then it is negated. Set the
|
||||
`nonegate` flag to suppress this behavior, and treat leading `!`
|
||||
characters normally. This is perhaps relevant if you wish to start the
|
||||
pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`
|
||||
characters at the start of a pattern will negate the pattern multiple
|
||||
times.
|
||||
|
||||
If a pattern starts with `#`, then it is treated as a comment, and
|
||||
will not match anything. Use `\#` to match a literal `#` at the
|
||||
start of a line, or set the `nocomment` flag to suppress this behavior.
|
||||
|
||||
The double-star character `**` is supported by default, unless the
|
||||
`noglobstar` flag is set. This is supported in the manner of bsdglob
|
||||
and bash 4.1, where `**` only has special significance if it is the only
|
||||
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
|
||||
`a/**b` will not.
|
||||
|
||||
If an escaped pattern has no matches, and the `nonull` flag is set,
|
||||
then minimatch.match returns the pattern as-provided, rather than
|
||||
interpreting the character escapes. For example,
|
||||
`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
|
||||
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
|
||||
that it does not resolve escaped pattern characters.
|
||||
|
||||
If brace expansion is not disabled, then it is performed before any
|
||||
other interpretation of the glob pattern. Thus, a pattern like
|
||||
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
|
||||
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
|
||||
checked for validity. Since those two are valid, matching proceeds.
|
1061
node_modules/minimatch/minimatch.js
generated
vendored
Normal file
1061
node_modules/minimatch/minimatch.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
61
node_modules/minimatch/package.json
generated
vendored
Normal file
61
node_modules/minimatch/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "minimatch@0.3",
|
||||
"_id": "minimatch@0.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=",
|
||||
"_location": "/minimatch",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "minimatch@0.3",
|
||||
"name": "minimatch",
|
||||
"escapedName": "minimatch",
|
||||
"rawSpec": "0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/glob"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
|
||||
"_shasum": "275d8edaac4f1bb3326472089e7949c8394699dd",
|
||||
"_spec": "minimatch@0.3",
|
||||
"_where": "/home/clemens/Dokumente/git/pixelnode/node_modules/glob",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/minimatch/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"lru-cache": "2",
|
||||
"sigmund": "~1.0.0"
|
||||
},
|
||||
"deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue",
|
||||
"description": "a glob matcher in javascript",
|
||||
"devDependencies": {
|
||||
"tap": ""
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"homepage": "https://github.com/isaacs/minimatch#readme",
|
||||
"license": {
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/isaacs/minimatch/raw/master/LICENSE"
|
||||
},
|
||||
"main": "minimatch.js",
|
||||
"name": "minimatch",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/minimatch.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"version": "0.3.0"
|
||||
}
|
399
node_modules/minimatch/test/basic.js
generated
vendored
Normal file
399
node_modules/minimatch/test/basic.js
generated
vendored
Normal file
@@ -0,0 +1,399 @@
|
||||
// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test
|
||||
//
|
||||
// TODO: Some of these tests do very bad things with backslashes, and will
|
||||
// most likely fail badly on windows. They should probably be skipped.
|
||||
|
||||
var tap = require("tap")
|
||||
, globalBefore = Object.keys(global)
|
||||
, mm = require("../")
|
||||
, files = [ "a", "b", "c", "d", "abc"
|
||||
, "abd", "abe", "bb", "bcd"
|
||||
, "ca", "cb", "dd", "de"
|
||||
, "bdir/", "bdir/cfile"]
|
||||
, next = files.concat([ "a-b", "aXb"
|
||||
, ".x", ".y" ])
|
||||
|
||||
|
||||
var patterns =
|
||||
[ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test"
|
||||
, ["a*", ["a", "abc", "abd", "abe"]]
|
||||
, ["X*", ["X*"], {nonull: true}]
|
||||
|
||||
// allow null glob expansion
|
||||
, ["X*", []]
|
||||
|
||||
// isaacs: Slightly different than bash/sh/ksh
|
||||
// \\* is not un-escaped to literal "*" in a failed match,
|
||||
// but it does make it get treated as a literal star
|
||||
, ["\\*", ["\\*"], {nonull: true}]
|
||||
, ["\\**", ["\\**"], {nonull: true}]
|
||||
, ["\\*\\*", ["\\*\\*"], {nonull: true}]
|
||||
|
||||
, ["b*/", ["bdir/"]]
|
||||
, ["c*", ["c", "ca", "cb"]]
|
||||
, ["**", files]
|
||||
|
||||
, ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}]
|
||||
, ["s/\\..*//", ["s/\\..*//"], {nonull: true}]
|
||||
|
||||
, "legendary larry crashes bashes"
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}]
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}]
|
||||
|
||||
, "character classes"
|
||||
, ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]]
|
||||
, ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd",
|
||||
"bdir/", "ca", "cb", "dd", "de"]]
|
||||
, ["a*[^c]", ["abd", "abe"]]
|
||||
, function () { files.push("a-b", "aXb") }
|
||||
, ["a[X-]b", ["a-b", "aXb"]]
|
||||
, function () { files.push(".x", ".y") }
|
||||
, ["[^a-c]*", ["d", "dd", "de"]]
|
||||
, function () { files.push("a*b/", "a*b/ooo") }
|
||||
, ["a\\*b/*", ["a*b/ooo"]]
|
||||
, ["a\\*?/*", ["a*b/ooo"]]
|
||||
, ["*\\\\!*", [], {null: true}, ["echo !7"]]
|
||||
, ["*\\!*", ["echo !7"], null, ["echo !7"]]
|
||||
, ["*.\\*", ["r.*"], null, ["r.*"]]
|
||||
, ["a[b]c", ["abc"]]
|
||||
, ["a[\\b]c", ["abc"]]
|
||||
, ["a?c", ["abc"]]
|
||||
, ["a\\*c", [], {null: true}, ["abc"]]
|
||||
, ["", [""], { null: true }, [""]]
|
||||
|
||||
, "http://www.opensource.apple.com/source/bash/bash-23/" +
|
||||
"bash/tests/glob-test"
|
||||
, function () { files.push("man/", "man/man1/", "man/man1/bash.1") }
|
||||
, ["*/man*/bash.*", ["man/man1/bash.1"]]
|
||||
, ["man/man1/bash.1", ["man/man1/bash.1"]]
|
||||
, ["a***c", ["abc"], null, ["abc"]]
|
||||
, ["a*****?c", ["abc"], null, ["abc"]]
|
||||
, ["?*****??", ["abc"], null, ["abc"]]
|
||||
, ["*****??", ["abc"], null, ["abc"]]
|
||||
, ["?*****?c", ["abc"], null, ["abc"]]
|
||||
, ["?***?****c", ["abc"], null, ["abc"]]
|
||||
, ["?***?****?", ["abc"], null, ["abc"]]
|
||||
, ["?***?****", ["abc"], null, ["abc"]]
|
||||
, ["*******c", ["abc"], null, ["abc"]]
|
||||
, ["*******?", ["abc"], null, ["abc"]]
|
||||
, ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["[-abc]", ["-"], null, ["-"]]
|
||||
, ["[abc-]", ["-"], null, ["-"]]
|
||||
, ["\\", ["\\"], null, ["\\"]]
|
||||
, ["[\\\\]", ["\\"], null, ["\\"]]
|
||||
, ["[[]", ["["], null, ["["]]
|
||||
, ["[", ["["], null, ["["]]
|
||||
, ["[*", ["[abc"], null, ["[abc"]]
|
||||
, "a right bracket shall lose its special meaning and\n" +
|
||||
"represent itself in a bracket expression if it occurs\n" +
|
||||
"first in the list. -- POSIX.2 2.8.3.2"
|
||||
, ["[]]", ["]"], null, ["]"]]
|
||||
, ["[]-]", ["]"], null, ["]"]]
|
||||
, ["[a-\z]", ["p"], null, ["p"]]
|
||||
, ["??**********?****?", [], { null: true }, ["abc"]]
|
||||
, ["??**********?****c", [], { null: true }, ["abc"]]
|
||||
, ["?************c****?****", [], { null: true }, ["abc"]]
|
||||
, ["*c*?**", [], { null: true }, ["abc"]]
|
||||
, ["a*****c*?**", [], { null: true }, ["abc"]]
|
||||
, ["a********???*******", [], { null: true }, ["abc"]]
|
||||
, ["[]", [], { null: true }, ["a"]]
|
||||
, ["[abc", [], { null: true }, ["["]]
|
||||
|
||||
, "nocase tests"
|
||||
, ["XYZ", ["xYz"], { nocase: true, null: true }
|
||||
, ["xYz", "ABC", "IjK"]]
|
||||
, ["ab*", ["ABC"], { nocase: true, null: true }
|
||||
, ["xYz", "ABC", "IjK"]]
|
||||
, ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true }
|
||||
, ["xYz", "ABC", "IjK"]]
|
||||
|
||||
// [ pattern, [matches], MM opts, files, TAP opts]
|
||||
, "onestar/twostar"
|
||||
, ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]]
|
||||
, ["{/?,*}", ["/a", "bb"], {null: true}
|
||||
, ["/a", "/b/b", "/a/b/c", "bb"]]
|
||||
|
||||
, "dots should not match unless requested"
|
||||
, ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]]
|
||||
|
||||
// .. and . can only match patterns starting with .,
|
||||
// even when options.dot is set.
|
||||
, function () {
|
||||
files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"]
|
||||
}
|
||||
, ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}]
|
||||
, ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}]
|
||||
, ["a/*/b", ["a/c/b"], {dot:false}]
|
||||
, ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}]
|
||||
|
||||
|
||||
// this also tests that changing the options needs
|
||||
// to change the cache key, even if the pattern is
|
||||
// the same!
|
||||
, ["**", ["a/b","a/.d",".a/.d"], { dot: true }
|
||||
, [ ".a/.d", "a/.d", "a/b"]]
|
||||
|
||||
, "paren sets cannot contain slashes"
|
||||
, ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]]
|
||||
|
||||
// brace sets trump all else.
|
||||
//
|
||||
// invalid glob pattern. fails on bash4 and bsdglob.
|
||||
// however, in this implementation, it's easier just
|
||||
// to do the intuitive thing, and let brace-expansion
|
||||
// actually come before parsing any extglob patterns,
|
||||
// like the documentation seems to say.
|
||||
//
|
||||
// XXX: if anyone complains about this, either fix it
|
||||
// or tell them to grow up and stop complaining.
|
||||
//
|
||||
// bash/bsdglob says this:
|
||||
// , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]]
|
||||
// but we do this instead:
|
||||
, ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]]
|
||||
|
||||
// test partial parsing in the presence of comment/negation chars
|
||||
, ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]]
|
||||
, ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]]
|
||||
|
||||
// like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped.
|
||||
, ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g"
|
||||
, ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"]
|
||||
, {}
|
||||
, ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]]
|
||||
|
||||
|
||||
// crazy nested {,,} and *(||) tests.
|
||||
, function () {
|
||||
files = [ "a", "b", "c", "d"
|
||||
, "ab", "ac", "ad"
|
||||
, "bc", "cb"
|
||||
, "bc,d", "c,db", "c,d"
|
||||
, "d)", "(b|c", "*(b|c"
|
||||
, "b|c", "b|cc", "cb|c"
|
||||
, "x(a|b|c)", "x(a|c)"
|
||||
, "(a|b|c)", "(a|c)"]
|
||||
}
|
||||
, ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]]
|
||||
, ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]]
|
||||
// a
|
||||
// *(b|c)
|
||||
// *(b|d)
|
||||
, ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]]
|
||||
, ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]]
|
||||
|
||||
|
||||
// test various flag settings.
|
||||
, [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"]
|
||||
, { noext: true } ]
|
||||
, ["a?b", ["x/y/acb", "acb/"], {matchBase: true}
|
||||
, ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ]
|
||||
, ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]]
|
||||
|
||||
|
||||
// begin channelling Boole and deMorgan...
|
||||
, "negation tests"
|
||||
, function () {
|
||||
files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"]
|
||||
}
|
||||
|
||||
// anything that is NOT a* matches.
|
||||
, ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]]
|
||||
|
||||
// anything that IS !a* matches.
|
||||
, ["!a*", ["!ab", "!abc"], {nonegate: true}]
|
||||
|
||||
// anything that IS a* matches
|
||||
, ["!!a*", ["a!b"]]
|
||||
|
||||
// anything that is NOT !a* matches
|
||||
, ["!\\!a*", ["a!b", "d", "e", "\\!a"]]
|
||||
|
||||
// negation nestled within a pattern
|
||||
, function () {
|
||||
files = [ "foo.js"
|
||||
, "foo.bar"
|
||||
// can't match this one without negative lookbehind.
|
||||
, "foo.js.js"
|
||||
, "blar.js"
|
||||
, "foo."
|
||||
, "boo.js.boo" ]
|
||||
}
|
||||
, ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ]
|
||||
|
||||
// https://github.com/isaacs/minimatch/issues/5
|
||||
, function () {
|
||||
files = [ 'a/b/.x/c'
|
||||
, 'a/b/.x/c/d'
|
||||
, 'a/b/.x/c/d/e'
|
||||
, 'a/b/.x'
|
||||
, 'a/b/.x/'
|
||||
, 'a/.x/b'
|
||||
, '.x'
|
||||
, '.x/'
|
||||
, '.x/a'
|
||||
, '.x/a/b'
|
||||
, 'a/.x/b/.x/c'
|
||||
, '.x/.x' ]
|
||||
}
|
||||
, ["**/.x/**", [ '.x/'
|
||||
, '.x/a'
|
||||
, '.x/a/b'
|
||||
, 'a/.x/b'
|
||||
, 'a/b/.x/'
|
||||
, 'a/b/.x/c'
|
||||
, 'a/b/.x/c/d'
|
||||
, 'a/b/.x/c/d/e' ] ]
|
||||
|
||||
]
|
||||
|
||||
var regexps =
|
||||
[ '/^(?:(?=.)a[^/]*?)$/',
|
||||
'/^(?:(?=.)X[^/]*?)$/',
|
||||
'/^(?:(?=.)X[^/]*?)$/',
|
||||
'/^(?:\\*)$/',
|
||||
'/^(?:(?=.)\\*[^/]*?)$/',
|
||||
'/^(?:\\*\\*)$/',
|
||||
'/^(?:(?=.)b[^/]*?\\/)$/',
|
||||
'/^(?:(?=.)c[^/]*?)$/',
|
||||
'/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/',
|
||||
'/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/',
|
||||
'/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/',
|
||||
'/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/',
|
||||
'/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/',
|
||||
'/^(?:(?!\\.)(?=.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(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/',
|
||||
'/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ]
|
||||
var re = 0;
|
||||
|
||||
tap.test("basic tests", function (t) {
|
||||
var start = Date.now()
|
||||
|
||||
// [ pattern, [matches], MM opts, files, TAP opts]
|
||||
patterns.forEach(function (c) {
|
||||
if (typeof c === "function") return c()
|
||||
if (typeof c === "string") return t.comment(c)
|
||||
|
||||
var pattern = c[0]
|
||||
, expect = c[1].sort(alpha)
|
||||
, options = c[2] || {}
|
||||
, f = c[3] || files
|
||||
, tapOpts = c[4] || {}
|
||||
|
||||
// options.debug = true
|
||||
var m = new mm.Minimatch(pattern, options)
|
||||
var r = m.makeRe()
|
||||
var expectRe = regexps[re++]
|
||||
tapOpts.re = String(r) || JSON.stringify(r)
|
||||
tapOpts.files = JSON.stringify(f)
|
||||
tapOpts.pattern = pattern
|
||||
tapOpts.set = m.set
|
||||
tapOpts.negated = m.negate
|
||||
|
||||
var actual = mm.match(f, pattern, options)
|
||||
actual.sort(alpha)
|
||||
|
||||
t.equivalent( actual, expect
|
||||
, JSON.stringify(pattern) + " " + JSON.stringify(expect)
|
||||
, tapOpts )
|
||||
|
||||
t.equal(tapOpts.re, expectRe, tapOpts)
|
||||
})
|
||||
|
||||
t.comment("time=" + (Date.now() - start) + "ms")
|
||||
t.end()
|
||||
})
|
||||
|
||||
tap.test("global leak test", function (t) {
|
||||
var globalAfter = Object.keys(global)
|
||||
t.equivalent(globalAfter, globalBefore, "no new globals, please")
|
||||
t.end()
|
||||
})
|
||||
|
||||
function alpha (a, b) {
|
||||
return a > b ? 1 : -1
|
||||
}
|
33
node_modules/minimatch/test/brace-expand.js
generated
vendored
Normal file
33
node_modules/minimatch/test/brace-expand.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
var tap = require("tap")
|
||||
, minimatch = require("../")
|
||||
|
||||
tap.test("brace expansion", function (t) {
|
||||
// [ pattern, [expanded] ]
|
||||
; [ [ "a{b,c{d,e},{f,g}h}x{y,z}"
|
||||
, [ "abxy"
|
||||
, "abxz"
|
||||
, "acdxy"
|
||||
, "acdxz"
|
||||
, "acexy"
|
||||
, "acexz"
|
||||
, "afhxy"
|
||||
, "afhxz"
|
||||
, "aghxy"
|
||||
, "aghxz" ] ]
|
||||
, [ "a{1..5}b"
|
||||
, [ "a1b"
|
||||
, "a2b"
|
||||
, "a3b"
|
||||
, "a4b"
|
||||
, "a5b" ] ]
|
||||
, [ "a{b}c", ["a{b}c"] ]
|
||||
].forEach(function (tc) {
|
||||
var p = tc[0]
|
||||
, expect = tc[1]
|
||||
t.equivalent(minimatch.braceExpand(p), expect, p)
|
||||
})
|
||||
console.error("ending")
|
||||
t.end()
|
||||
})
|
||||
|
||||
|
14
node_modules/minimatch/test/caching.js
generated
vendored
Normal file
14
node_modules/minimatch/test/caching.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var Minimatch = require("../minimatch.js").Minimatch
|
||||
var tap = require("tap")
|
||||
tap.test("cache test", function (t) {
|
||||
var mm1 = new Minimatch("a?b")
|
||||
var mm2 = new Minimatch("a?b")
|
||||
t.equal(mm1, mm2, "should get the same object")
|
||||
// the lru should drop it after 100 entries
|
||||
for (var i = 0; i < 100; i ++) {
|
||||
new Minimatch("a"+i)
|
||||
}
|
||||
mm2 = new Minimatch("a?b")
|
||||
t.notEqual(mm1, mm2, "cache should have dropped")
|
||||
t.end()
|
||||
})
|
274
node_modules/minimatch/test/defaults.js
generated
vendored
Normal file
274
node_modules/minimatch/test/defaults.js
generated
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test
|
||||
//
|
||||
// TODO: Some of these tests do very bad things with backslashes, and will
|
||||
// most likely fail badly on windows. They should probably be skipped.
|
||||
|
||||
var tap = require("tap")
|
||||
, globalBefore = Object.keys(global)
|
||||
, mm = require("../")
|
||||
, files = [ "a", "b", "c", "d", "abc"
|
||||
, "abd", "abe", "bb", "bcd"
|
||||
, "ca", "cb", "dd", "de"
|
||||
, "bdir/", "bdir/cfile"]
|
||||
, next = files.concat([ "a-b", "aXb"
|
||||
, ".x", ".y" ])
|
||||
|
||||
tap.test("basic tests", function (t) {
|
||||
var start = Date.now()
|
||||
|
||||
// [ pattern, [matches], MM opts, files, TAP opts]
|
||||
; [ "http://www.bashcookbook.com/bashinfo" +
|
||||
"/source/bash-1.14.7/tests/glob-test"
|
||||
, ["a*", ["a", "abc", "abd", "abe"]]
|
||||
, ["X*", ["X*"], {nonull: true}]
|
||||
|
||||
// allow null glob expansion
|
||||
, ["X*", []]
|
||||
|
||||
// isaacs: Slightly different than bash/sh/ksh
|
||||
// \\* is not un-escaped to literal "*" in a failed match,
|
||||
// but it does make it get treated as a literal star
|
||||
, ["\\*", ["\\*"], {nonull: true}]
|
||||
, ["\\**", ["\\**"], {nonull: true}]
|
||||
, ["\\*\\*", ["\\*\\*"], {nonull: true}]
|
||||
|
||||
, ["b*/", ["bdir/"]]
|
||||
, ["c*", ["c", "ca", "cb"]]
|
||||
, ["**", files]
|
||||
|
||||
, ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}]
|
||||
, ["s/\\..*//", ["s/\\..*//"], {nonull: true}]
|
||||
|
||||
, "legendary larry crashes bashes"
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}]
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"
|
||||
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}]
|
||||
|
||||
, "character classes"
|
||||
, ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]]
|
||||
, ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd",
|
||||
"bdir/", "ca", "cb", "dd", "de"]]
|
||||
, ["a*[^c]", ["abd", "abe"]]
|
||||
, function () { files.push("a-b", "aXb") }
|
||||
, ["a[X-]b", ["a-b", "aXb"]]
|
||||
, function () { files.push(".x", ".y") }
|
||||
, ["[^a-c]*", ["d", "dd", "de"]]
|
||||
, function () { files.push("a*b/", "a*b/ooo") }
|
||||
, ["a\\*b/*", ["a*b/ooo"]]
|
||||
, ["a\\*?/*", ["a*b/ooo"]]
|
||||
, ["*\\\\!*", [], {null: true}, ["echo !7"]]
|
||||
, ["*\\!*", ["echo !7"], null, ["echo !7"]]
|
||||
, ["*.\\*", ["r.*"], null, ["r.*"]]
|
||||
, ["a[b]c", ["abc"]]
|
||||
, ["a[\\b]c", ["abc"]]
|
||||
, ["a?c", ["abc"]]
|
||||
, ["a\\*c", [], {null: true}, ["abc"]]
|
||||
, ["", [""], { null: true }, [""]]
|
||||
|
||||
, "http://www.opensource.apple.com/source/bash/bash-23/" +
|
||||
"bash/tests/glob-test"
|
||||
, function () { files.push("man/", "man/man1/", "man/man1/bash.1") }
|
||||
, ["*/man*/bash.*", ["man/man1/bash.1"]]
|
||||
, ["man/man1/bash.1", ["man/man1/bash.1"]]
|
||||
, ["a***c", ["abc"], null, ["abc"]]
|
||||
, ["a*****?c", ["abc"], null, ["abc"]]
|
||||
, ["?*****??", ["abc"], null, ["abc"]]
|
||||
, ["*****??", ["abc"], null, ["abc"]]
|
||||
, ["?*****?c", ["abc"], null, ["abc"]]
|
||||
, ["?***?****c", ["abc"], null, ["abc"]]
|
||||
, ["?***?****?", ["abc"], null, ["abc"]]
|
||||
, ["?***?****", ["abc"], null, ["abc"]]
|
||||
, ["*******c", ["abc"], null, ["abc"]]
|
||||
, ["*******?", ["abc"], null, ["abc"]]
|
||||
, ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
||||
, ["[-abc]", ["-"], null, ["-"]]
|
||||
, ["[abc-]", ["-"], null, ["-"]]
|
||||
, ["\\", ["\\"], null, ["\\"]]
|
||||
, ["[\\\\]", ["\\"], null, ["\\"]]
|
||||
, ["[[]", ["["], null, ["["]]
|
||||
, ["[", ["["], null, ["["]]
|
||||
, ["[*", ["[abc"], null, ["[abc"]]
|
||||
, "a right bracket shall lose its special meaning and\n" +
|
||||
"represent itself in a bracket expression if it occurs\n" +
|
||||
"first in the list. -- POSIX.2 2.8.3.2"
|
||||
, ["[]]", ["]"], null, ["]"]]
|
||||
, ["[]-]", ["]"], null, ["]"]]
|
||||
, ["[a-\z]", ["p"], null, ["p"]]
|
||||
, ["??**********?****?", [], { null: true }, ["abc"]]
|
||||
, ["??**********?****c", [], { null: true }, ["abc"]]
|
||||
, ["?************c****?****", [], { null: true }, ["abc"]]
|
||||
, ["*c*?**", [], { null: true }, ["abc"]]
|
||||
, ["a*****c*?**", [], { null: true }, ["abc"]]
|
||||
, ["a********???*******", [], { null: true }, ["abc"]]
|
||||
, ["[]", [], { null: true }, ["a"]]
|
||||
, ["[abc", [], { null: true }, ["["]]
|
||||
|
||||
, "nocase tests"
|
||||
, ["XYZ", ["xYz"], { nocase: true, null: true }
|
||||
, ["xYz", "ABC", "IjK"]]
|
||||
, ["ab*", ["ABC"], { nocase: true, null: true }
|
||||
, ["xYz", "ABC", "IjK"]]
|
||||
, ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true }
|
||||
, ["xYz", "ABC", "IjK"]]
|
||||
|
||||
// [ pattern, [matches], MM opts, files, TAP opts]
|
||||
, "onestar/twostar"
|
||||
, ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]]
|
||||
, ["{/?,*}", ["/a", "bb"], {null: true}
|
||||
, ["/a", "/b/b", "/a/b/c", "bb"]]
|
||||
|
||||
, "dots should not match unless requested"
|
||||
, ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]]
|
||||
|
||||
// .. and . can only match patterns starting with .,
|
||||
// even when options.dot is set.
|
||||
, function () {
|
||||
files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"]
|
||||
}
|
||||
, ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}]
|
||||
, ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}]
|
||||
, ["a/*/b", ["a/c/b"], {dot:false}]
|
||||
, ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}]
|
||||
|
||||
|
||||
// this also tests that changing the options needs
|
||||
// to change the cache key, even if the pattern is
|
||||
// the same!
|
||||
, ["**", ["a/b","a/.d",".a/.d"], { dot: true }
|
||||
, [ ".a/.d", "a/.d", "a/b"]]
|
||||
|
||||
, "paren sets cannot contain slashes"
|
||||
, ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]]
|
||||
|
||||
// brace sets trump all else.
|
||||
//
|
||||
// invalid glob pattern. fails on bash4 and bsdglob.
|
||||
// however, in this implementation, it's easier just
|
||||
// to do the intuitive thing, and let brace-expansion
|
||||
// actually come before parsing any extglob patterns,
|
||||
// like the documentation seems to say.
|
||||
//
|
||||
// XXX: if anyone complains about this, either fix it
|
||||
// or tell them to grow up and stop complaining.
|
||||
//
|
||||
// bash/bsdglob says this:
|
||||
// , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]]
|
||||
// but we do this instead:
|
||||
, ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]]
|
||||
|
||||
// test partial parsing in the presence of comment/negation chars
|
||||
, ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]]
|
||||
, ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]]
|
||||
|
||||
// like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped.
|
||||
, ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g"
|
||||
, ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"]
|
||||
, {}
|
||||
, ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]]
|
||||
|
||||
|
||||
// crazy nested {,,} and *(||) tests.
|
||||
, function () {
|
||||
files = [ "a", "b", "c", "d"
|
||||
, "ab", "ac", "ad"
|
||||
, "bc", "cb"
|
||||
, "bc,d", "c,db", "c,d"
|
||||
, "d)", "(b|c", "*(b|c"
|
||||
, "b|c", "b|cc", "cb|c"
|
||||
, "x(a|b|c)", "x(a|c)"
|
||||
, "(a|b|c)", "(a|c)"]
|
||||
}
|
||||
, ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]]
|
||||
, ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]]
|
||||
// a
|
||||
// *(b|c)
|
||||
// *(b|d)
|
||||
, ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]]
|
||||
, ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]]
|
||||
|
||||
|
||||
// test various flag settings.
|
||||
, [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"]
|
||||
, { noext: true } ]
|
||||
, ["a?b", ["x/y/acb", "acb/"], {matchBase: true}
|
||||
, ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ]
|
||||
, ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]]
|
||||
|
||||
|
||||
// begin channelling Boole and deMorgan...
|
||||
, "negation tests"
|
||||
, function () {
|
||||
files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"]
|
||||
}
|
||||
|
||||
// anything that is NOT a* matches.
|
||||
, ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]]
|
||||
|
||||
// anything that IS !a* matches.
|
||||
, ["!a*", ["!ab", "!abc"], {nonegate: true}]
|
||||
|
||||
// anything that IS a* matches
|
||||
, ["!!a*", ["a!b"]]
|
||||
|
||||
// anything that is NOT !a* matches
|
||||
, ["!\\!a*", ["a!b", "d", "e", "\\!a"]]
|
||||
|
||||
// negation nestled within a pattern
|
||||
, function () {
|
||||
files = [ "foo.js"
|
||||
, "foo.bar"
|
||||
// can't match this one without negative lookbehind.
|
||||
, "foo.js.js"
|
||||
, "blar.js"
|
||||
, "foo."
|
||||
, "boo.js.boo" ]
|
||||
}
|
||||
, ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ]
|
||||
|
||||
].forEach(function (c) {
|
||||
if (typeof c === "function") return c()
|
||||
if (typeof c === "string") return t.comment(c)
|
||||
|
||||
var pattern = c[0]
|
||||
, expect = c[1].sort(alpha)
|
||||
, options = c[2]
|
||||
, f = c[3] || files
|
||||
, tapOpts = c[4] || {}
|
||||
|
||||
// options.debug = true
|
||||
var Class = mm.defaults(options).Minimatch
|
||||
var m = new Class(pattern, {})
|
||||
var r = m.makeRe()
|
||||
tapOpts.re = String(r) || JSON.stringify(r)
|
||||
tapOpts.files = JSON.stringify(f)
|
||||
tapOpts.pattern = pattern
|
||||
tapOpts.set = m.set
|
||||
tapOpts.negated = m.negate
|
||||
|
||||
var actual = mm.match(f, pattern, options)
|
||||
actual.sort(alpha)
|
||||
|
||||
t.equivalent( actual, expect
|
||||
, JSON.stringify(pattern) + " " + JSON.stringify(expect)
|
||||
, tapOpts )
|
||||
})
|
||||
|
||||
t.comment("time=" + (Date.now() - start) + "ms")
|
||||
t.end()
|
||||
})
|
||||
|
||||
tap.test("global leak test", function (t) {
|
||||
var globalAfter = Object.keys(global)
|
||||
t.equivalent(globalAfter, globalBefore, "no new globals, please")
|
||||
t.end()
|
||||
})
|
||||
|
||||
function alpha (a, b) {
|
||||
return a > b ? 1 : -1
|
||||
}
|
8
node_modules/minimatch/test/extglob-ending-with-state-char.js
generated
vendored
Normal file
8
node_modules/minimatch/test/extglob-ending-with-state-char.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
var test = require('tap').test
|
||||
var minimatch = require('../')
|
||||
|
||||
test('extglob ending with statechar', function(t) {
|
||||
t.notOk(minimatch('ax', 'a?(b*)'))
|
||||
t.ok(minimatch('ax', '?(a*|b)'))
|
||||
t.end()
|
||||
})
|
Reference in New Issue
Block a user