pax_global_header 0000666 0000000 0000000 00000000064 13002232335 0014503 g ustar 00root root 0000000 0000000 52 comment=4979130bdb5522e9a8d45472ce73ffb9427a9f27
extglob-1.0.0/ 0000775 0000000 0000000 00000000000 13002232335 0013145 5 ustar 00root root 0000000 0000000 extglob-1.0.0/.editorconfig 0000664 0000000 0000000 00000000405 13002232335 0015621 0 ustar 00root root 0000000 0000000 root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
[{**/{actual,fixtures,expected,templates}/**,*.md}]
trim_trailing_whitespace = false
insert_final_newline = false extglob-1.0.0/.eslintrc.json 0000664 0000000 0000000 00000007125 13002232335 0015746 0 ustar 00root root 0000000 0000000 {
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
},
"env": {
"browser": false,
"es6": true,
"node": true,
"mocha": true
},
"globals": {
"document": false,
"navigator": false,
"window": false
},
"rules": {
"accessor-pairs": 2,
"arrow-spacing": [2, { "before": true, "after": true }],
"block-spacing": [2, "always"],
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"comma-dangle": [2, "never"],
"comma-spacing": [2, { "before": false, "after": true }],
"comma-style": [2, "last"],
"constructor-super": 2,
"curly": [2, "multi-line"],
"dot-location": [2, "property"],
"eol-last": 2,
"eqeqeq": [2, "allow-null"],
"generator-star-spacing": [2, { "before": true, "after": true }],
"handle-callback-err": [2, "^(err|error)$" ],
"indent": [2, 2, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"keyword-spacing": [2, { "before": true, "after": true }],
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"new-parens": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-class-assign": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": [2, "functions"],
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [2, { "max": 1 }],
"no-native-reassign": 0,
"no-negated-in-lhs": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-require": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-proto": 0,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-return-assign": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 0,
"no-undef": 2,
"no-undef-init": 2,
"no-unexpected-multiline": 2,
"no-unneeded-ternary": [2, { "defaultAssignment": false }],
"no-unreachable": 2,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
"no-useless-call": 0,
"no-with": 2,
"one-var": [0, { "initialized": "never" }],
"operator-linebreak": [0, "after", { "overrides": { "?": "before", ":": "before" } }],
"padded-blocks": [0, "never"],
"quotes": [2, "single", "avoid-escape"],
"radix": 2,
"semi": [2, "always"],
"semi-spacing": [2, { "before": false, "after": true }],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
"use-isnan": 2,
"valid-typeof": 2,
"wrap-iife": [2, "any"],
"yoda": [2, "never"]
}
}
extglob-1.0.0/.gitattributes 0000664 0000000 0000000 00000000017 13002232335 0016036 0 ustar 00root root 0000000 0000000 *.* text eol=lf extglob-1.0.0/.gitignore 0000664 0000000 0000000 00000000331 13002232335 0015132 0 ustar 00root root 0000000 0000000 # always ignore files
*.DS_Store
*.sublime-*
# test related, or directories generated by tests
test/actual
actual
coverage
# npm
node_modules
npm-debug.log
# misc
_gh_pages
bower_components
vendor
temp
tmp
TODO.md
extglob-1.0.0/.travis.yml 0000664 0000000 0000000 00000000154 13002232335 0015256 0 ustar 00root root 0000000 0000000 sudo: false
language: node_js
os:
- linux
- osx
node_js:
- node
- '6'
- '5'
- '0.12'
- '0.10'
extglob-1.0.0/.verb.md 0000664 0000000 0000000 00000005737 13002232335 0014517 0 ustar 00root root 0000000 0000000 - Convert an extglob string to a regex-compatible string.
- More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) (minimatch fails a large percentage of the extglob tests)
- Handles [negation patterns](#extglob-patterns)
- Handles [nested patterns](#extglob-patterns)
- Organized code base, easy to maintain and make changes when edge cases arise
- As you can see by the [benchmarks](#benchmarks), extglob doesn't pay with speed for it's completeness, accuracy and quality.
**Heads up!**: This library only supports extglobs, to handle full glob patterns and other extended globbing features use [micromatch][] instead.
## Usage
The main export is a function that takes a string and options, and returns an object with the parsed AST and the compiled `.output`, which is a regex-compatible string that can be used for matching.
```js
var extglob = require('{%= name %}');
console.log(extglob('!(xyz)*.js'));
```
## Extglob cheatsheet
Extended globbing patterns can be defined as follows (as described by the [bash man page][bash]):
| **pattern** | **regex equivalent** | **description** |
| --- | --- | --- |
| `?(pattern-list)` | `(...|...)?` | Matches zero or one occurrence of the given pattern(s) |
| `*(pattern-list)` | `(...|...)*` | Matches zero or more occurrences of the given pattern(s) |
| `+(pattern-list)` | `(...|...)+` | Matches one or more occurrences of the given pattern(s) |
| `@(pattern-list)` | `(...|...)` [^1] | Matches one of the given pattern(s) |
| `!(pattern-list)` | N/A | Matches anything except one of the given pattern(s) |
[^1]: `@` isn't a RegEx character.
## API
{%= apidocs("index.js") %}
## Options
Available options are based on the options from Bash (and the option names used in bash).
### options.nullglob
**Type**: `boolean`
**Default**: `undefined`
When enabled, the pattern itself will be returned when no matches are found.
### options.nonull
Alias for [options.nullglob](#optionsnullglob), included for parity with minimatch.
### options.cache
**Type**: `boolean`
**Default**: `undefined`
Functions are memoized based on the given glob patterns and options. Disable memoization by setting `options.cache` to false.
### options.failglob
**Type**: `boolean`
**Default**: `undefined`
Throw an error is no matches are found.
## Benchmarks
Last run on {%= date() %}
```sh
{%= docs("benchmark/last.md") %}
```
## Differences from Bash
This library has complete parity with Bash 4.3 with only a couple of minor differences.
- In some cases Bash returns true if the given string "contains" the pattern, whereas this library returns true if the string is an exact match for the pattern. You can relax this by setting `options.contains` to true.
- This library is more accurate than Bash and thus does not fail some of the tests that Bash 4.3 still lists as failing in their unit tests
[bash]: https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html
[micromatch]: https://github.com/jonschlinkert/micromatch
extglob-1.0.0/LICENSE 0000664 0000000 0000000 00000002077 13002232335 0014160 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 2015-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.
extglob-1.0.0/README.md 0000664 0000000 0000000 00000026250 13002232335 0014431 0 ustar 00root root 0000000 0000000 # extglob [](https://www.npmjs.com/package/extglob) [](https://npmjs.org/package/extglob) [](https://npmjs.org/package/extglob) [](https://travis-ci.org/jonschlinkert/extglob) [](https://ci.appveyor.com/project/jonschlinkert/extglob)
> Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save extglob
```
* Convert an extglob string to a regex-compatible string.
* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) (minimatch fails a large percentage of the extglob tests)
* Handles [negation patterns](#extglob-patterns)
* Handles [nested patterns](#extglob-patterns)
* Organized code base, easy to maintain and make changes when edge cases arise
* As you can see by the [benchmarks](#benchmarks), extglob doesn't pay with speed for it's completeness, accuracy and quality.
**Heads up!**: This library only supports extglobs, to handle full glob patterns and other extended globbing features use [micromatch](https://github.com/jonschlinkert/micromatch) instead.
## Usage
The main export is a function that takes a string and options, and returns an object with the parsed AST and the compiled `.output`, which is a regex-compatible string that can be used for matching.
```js
var extglob = require('extglob');
console.log(extglob('!(xyz)*.js'));
```
## Extglob cheatsheet
Extended globbing patterns can be defined as follows (as described by the [bash man page](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)):
| **pattern** | **regex equivalent** | **description** |
| --- | --- | --- |
| `?(pattern-list)` | `(... | ...)?` | Matches zero or one occurrence of the given pattern(s) |
| `*(pattern-list)` | `(... | ...)*` | Matches zero or more occurrences of the given pattern(s) |
| `+(pattern-list)` | `(... | ...)+` | Matches one or more occurrences of the given pattern(s) |
| `@(pattern-list)` | `(... | ...)` [1] | Matches one of the given pattern(s) |
| `!(pattern-list)` | N/A | Matches anything except one of the given pattern(s) |
## API
### [extglob](index.js#L37)
Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST.
**Example**
```js
var extglob = require('extglob');
console.log(extglob('*.!(*a)'));
//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?'
```
**Params**
* `pattern` **{String}**
* `options` **{Object}**
* `returns` **{String}**
### [.match](index.js#L68)
Takes an array of strings and an extglob pattern and returns a new array that contains only the strings that match the pattern.
**Example**
```js
var extglob = require('extglob');
console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)'));
//=> ['a.b', 'a.c']
```
**Params**
* `list` **{Array}**: Array of strings to match
* `pattern` **{String}**: Extglob pattern
* `options` **{Object}**
* `returns` **{Array}**: Returns an array of matches
### [.isMatch](index.js#L123)
Returns true if the specified `string` matches the given extglob `pattern`.
**Example**
```js
var extglob = require('extglob');
console.log(extglob.isMatch('a.a', '*.!(*a)'));
//=> false
console.log(extglob.isMatch('a.b', '*.!(*a)'));
//=> true
```
**Params**
* `string` **{String}**: String to match
* `pattern` **{String}**: Extglob pattern
* `options` **{String}**
* `returns` **{Boolean}**
### [.contains](index.js#L162)
Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but the pattern can match any part of the string.
**Example**
```js
var extglob = require('extglob');
console.log(extglob.contains('aa/bb/cc', '*b'));
//=> true
console.log(extglob.contains('aa/bb/cc', '*d'));
//=> false
```
**Params**
* `str` **{String}**: The string to match.
* `pattern` **{String}**: Glob pattern to use for matching.
* `options` **{Object}**
* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`.
### [.matcher](index.js#L196)
Takes an extglob pattern and returns a matcher function. The returned function takes the string to match as its only argument.
**Example**
```js
var extglob = require('extglob');
var isMatch = extglob.matcher('*.!(*a)');
console.log(isMatch('a.a'));
//=> false
console.log(isMatch('a.b'));
//=> true
```
**Params**
* `pattern` **{String}**: Extglob pattern
* `options` **{String}**
* `returns` **{Boolean}**
### [.create](index.js#L226)
Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST.
**Example**
```js
var extglob = require('extglob');
console.log(extglob.create('*.!(*a)').output);
//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?'
```
**Params**
* `str` **{String}**
* `options` **{Object}**
* `returns` **{String}**
### [.makeRe](index.js#L255)
Create a regular expression from the given `pattern` and `options`.
**Example**
```js
var extglob = require('extglob');
var re = extglob.makeRe('*.!(*a)');
console.log(re);
//=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/
```
**Params**
* `pattern` **{String}**: The pattern to convert to regex.
* `options` **{Object}**
* `returns` **{RegExp}**
## Options
Available options are based on the options from Bash (and the option names used in bash).
### options.nullglob
**Type**: `boolean`
**Default**: `undefined`
When enabled, the pattern itself will be returned when no matches are found.
### options.nonull
Alias for [options.nullglob](#optionsnullglob), included for parity with minimatch.
### options.cache
**Type**: `boolean`
**Default**: `undefined`
Functions are memoized based on the given glob patterns and options. Disable memoization by setting `options.cache` to false.
### options.failglob
**Type**: `boolean`
**Default**: `undefined`
Throw an error is no matches are found.
## Benchmarks
Last run on October 20, 2016
```sh
Benchmarking: (5 of 5)
· negation-nested
· negation-simple
· range-false
· range-true
· star-simple
# benchmark/fixtures/isMatch/negation-nested.js (49 bytes)
extglob x 1,988,591 ops/sec ±1.18% (84 runs sampled)
minimatch x 73,335 ops/sec ±1.38% (84 runs sampled)
fastest is extglob
# benchmark/fixtures/isMatch/negation-simple.js (43 bytes)
extglob x 2,320,380 ops/sec ±1.71% (86 runs sampled)
minimatch x 122,947 ops/sec ±1.28% (86 runs sampled)
fastest is extglob
# benchmark/fixtures/isMatch/range-false.js (56 bytes)
extglob x 1,729,572 ops/sec ±1.22% (84 runs sampled)
minimatch x 112,566 ops/sec ±1.26% (85 runs sampled)
fastest is extglob
# benchmark/fixtures/isMatch/range-true.js (56 bytes)
extglob x 1,819,085 ops/sec ±1.28% (83 runs sampled)
minimatch x 115,153 ops/sec ±1.50% (85 runs sampled)
fastest is extglob
# benchmark/fixtures/isMatch/star-simple.js (46 bytes)
extglob x 1,970,063 ops/sec ±1.46% (83 runs sampled)
minimatch x 138,805 ops/sec ±1.31% (87 runs sampled)
fastest is extglob
```
## Differences from Bash
This library has complete parity with Bash 4.3 with only a couple of minor differences.
* In some cases Bash returns true if the given string "contains" the pattern, whereas this library returns true if the string is an exact match for the pattern. You can relax this by setting `options.contains` to true.
* This library is more accurate than Bash and thus does not fail some of the tests that Bash 4.3 still lists as failing in their unit tests
## About
### Related projects
* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.")
* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.")
* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](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.")
* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`")
* [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).
### Contributors
| **Commits** | **Contributor**
|
| --- | --- | --- | --- | --- |
| 32 | [jonschlinkert](https://github.com/jonschlinkert) |
| 2 | [isiahmeadows](https://github.com/isiahmeadows) |
| 1 | [shinnn](https://github.com/shinnn) |
### 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/extglob/blob/master/LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 20, 2016._