first commit
This commit is contained in:
commit
e3e768c589
11 changed files with 340 additions and 0 deletions
10
.gitattributes
vendored
Normal file
10
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Enforce Unix newlines
|
||||
* text eol=lf
|
||||
|
||||
# binaries
|
||||
*.ai binary
|
||||
*.psd binary
|
||||
*.jpg binary
|
||||
*.gif binary
|
||||
*.png binary
|
||||
*.jpeg binary
|
||||
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
*.DS_Store
|
||||
*.sublime-*
|
||||
_gh_pages
|
||||
bower_components
|
||||
node_modules
|
||||
npm-debug.log
|
||||
temp
|
||||
test/actual
|
||||
tmp
|
||||
TODO.md
|
||||
vendor
|
||||
19
.jshintrc
Normal file
19
.jshintrc
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"asi": false,
|
||||
"boss": true,
|
||||
"camelcase": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"eqnull": true,
|
||||
"esnext": true,
|
||||
"immed": true,
|
||||
"latedef": false,
|
||||
"laxcomma": false,
|
||||
"mocha": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"node": true,
|
||||
"sub": true,
|
||||
"undef": true,
|
||||
"unused": true
|
||||
}
|
||||
8
.travis.yml
Normal file
8
.travis.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
- "iojs"
|
||||
git:
|
||||
depth: 10
|
||||
59
.verb.md
Normal file
59
.verb.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# {%= name %} {%= badge("fury") %} {%= badge("travis") %}
|
||||
|
||||
> {%= description %}
|
||||
|
||||
{%= include("install-npm", {save: true}) %}
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isExtglob = require('{%= name %}');
|
||||
```
|
||||
|
||||
**True**
|
||||
|
||||
```js
|
||||
isExtglob('?(abc)');
|
||||
isExtglob('@(abc)');
|
||||
isExtglob('!(abc)');
|
||||
isExtglob('*(abc)');
|
||||
isExtglob('+(abc)');
|
||||
```
|
||||
|
||||
**False**
|
||||
|
||||
Everything else...
|
||||
|
||||
```js
|
||||
isExtglob('foo.js');
|
||||
isExtglob('!foo.js');
|
||||
isExtglob('*.js');
|
||||
isExtglob('**/abc.js');
|
||||
isExtglob('abc/*.js');
|
||||
isExtglob('abc/(aaa|bbb).js');
|
||||
isExtglob('abc/[a-z].js');
|
||||
isExtglob('abc/{a,b}.js');
|
||||
isExtglob('abc/?.js');
|
||||
isExtglob('abc.js');
|
||||
isExtglob('abc/def/ghi.js');
|
||||
```
|
||||
|
||||
## Related
|
||||
{%= related(['extglob', 'micromatch', 'parse-glob']) %}
|
||||
|
||||
## Run tests
|
||||
{%= include("tests") %}
|
||||
|
||||
## Contributing
|
||||
{%= include("contributing") %}
|
||||
|
||||
## Author
|
||||
{%= include("author") %}
|
||||
|
||||
## License
|
||||
{%= copyright() %}
|
||||
{%= license() %}
|
||||
|
||||
***
|
||||
|
||||
{%= include("footer") %}
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-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.
|
||||
75
README.md
Normal file
75
README.md
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# is-extglob [](http://badge.fury.io/js/is-extglob) [](https://travis-ci.org/jonschlinkert/is-extglob)
|
||||
|
||||
> Returns true if a string has an extglob.
|
||||
|
||||
## Install with [npm](npmjs.org)
|
||||
|
||||
```bash
|
||||
npm i is-extglob --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isExtglob = require('is-extglob');
|
||||
```
|
||||
|
||||
**True**
|
||||
|
||||
```js
|
||||
isExtglob('?(abc)');
|
||||
isExtglob('@(abc)');
|
||||
isExtglob('!(abc)');
|
||||
isExtglob('*(abc)');
|
||||
isExtglob('+(abc)');
|
||||
```
|
||||
|
||||
**False**
|
||||
|
||||
Everything else...
|
||||
|
||||
```js
|
||||
isExtglob('foo.js');
|
||||
isExtglob('!foo.js');
|
||||
isExtglob('*.js');
|
||||
isExtglob('**/abc.js');
|
||||
isExtglob('abc/*.js');
|
||||
isExtglob('abc/(aaa|bbb).js');
|
||||
isExtglob('abc/[a-z].js');
|
||||
isExtglob('abc/{a,b}.js');
|
||||
isExtglob('abc/?.js');
|
||||
isExtglob('abc.js');
|
||||
isExtglob('abc/def/ghi.js');
|
||||
```
|
||||
|
||||
## Related
|
||||
* [extglob](https://github.com/jonschlinkert/extglob): Extended globs. extglobs add the expressive power of regular expressions to glob patterns.
|
||||
* [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.
|
||||
|
||||
## Run 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/is-extglob/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 06, 2015._
|
||||
14
browser.js
Normal file
14
browser.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
/*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
module.exports = function isExtglob(str) {
|
||||
return typeof str === 'string'
|
||||
&& /[@?!+*]\(/.test(str);
|
||||
};
|
||||
|
||||
},{}]},{},[1]);
|
||||
11
index.js
Normal file
11
index.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
module.exports = function isExtglob(str) {
|
||||
return typeof str === 'string'
|
||||
&& /[@?!+*]\(/.test(str);
|
||||
};
|
||||
48
package.json
Normal file
48
package.json
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "is-extglob",
|
||||
"description": "Returns true if a string has an extglob.",
|
||||
"version": "1.0.0",
|
||||
"homepage": "https://github.com/jonschlinkert/is-extglob",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"repository": "jonschlinkert/is-extglob",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-extglob/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"prepublish": "browserify -o browser.js -e index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"bash",
|
||||
"braces",
|
||||
"check",
|
||||
"exec",
|
||||
"extglob",
|
||||
"expression",
|
||||
"glob",
|
||||
"globbing",
|
||||
"globstar",
|
||||
"match",
|
||||
"matches",
|
||||
"pattern",
|
||||
"regex",
|
||||
"regular",
|
||||
"string",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
64
test.js
Normal file
64
test.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
require('should');
|
||||
var isExtglob = require('./');
|
||||
|
||||
describe('isExtglob', function () {
|
||||
it('should return true when the string has an extglob:', function () {
|
||||
isExtglob('?(abc)').should.be.true;
|
||||
isExtglob('@(abc)').should.be.true;
|
||||
isExtglob('!(abc)').should.be.true;
|
||||
isExtglob('*(abc)').should.be.true;
|
||||
isExtglob('+(abc)').should.be.true;
|
||||
isExtglob('xyz/?(abc)/xyz').should.be.true;
|
||||
isExtglob('xyz/@(abc)/xyz').should.be.true;
|
||||
isExtglob('xyz/!(abc)/xyz').should.be.true;
|
||||
isExtglob('xyz/*(abc)/xyz').should.be.true;
|
||||
isExtglob('xyz/+(abc)/xyz').should.be.true;
|
||||
isExtglob('?(abc|xyz)/xyz').should.be.true;
|
||||
isExtglob('@(abc|xyz)').should.be.true;
|
||||
isExtglob('!(abc|xyz)').should.be.true;
|
||||
isExtglob('*(abc|xyz)').should.be.true;
|
||||
isExtglob('+(abc|xyz)').should.be.true;
|
||||
});
|
||||
|
||||
it('should return false when the string does not have an extglob:', function () {
|
||||
isExtglob('? (abc)').should.be.false;
|
||||
isExtglob('@.(abc)').should.be.false;
|
||||
isExtglob('!&(abc)').should.be.false;
|
||||
isExtglob('*z(abc)').should.be.false;
|
||||
isExtglob('+~(abc)').should.be.false;
|
||||
isExtglob().should.be.false;
|
||||
isExtglob(null).should.be.false;
|
||||
isExtglob(['**/*.js']).should.be.false;
|
||||
isExtglob(['foo.js']).should.be.false;
|
||||
isExtglob('*.js').should.be.false;
|
||||
isExtglob('!*.js').should.be.false;
|
||||
isExtglob('!foo').should.be.false;
|
||||
isExtglob('!foo.js').should.be.false;
|
||||
isExtglob('**/abc.js').should.be.false;
|
||||
isExtglob('abc/*.js').should.be.false;
|
||||
isExtglob('abc/{a,b}.js').should.be.false;
|
||||
isExtglob('abc/{a..z}.js').should.be.false;
|
||||
isExtglob('abc/{a..z..2}.js').should.be.false;
|
||||
isExtglob('abc/(aaa|bbb).js').should.be.false;
|
||||
isExtglob('abc/?.js').should.be.false;
|
||||
isExtglob('?.js').should.be.false;
|
||||
isExtglob('[abc].js').should.be.false;
|
||||
isExtglob('[^abc].js').should.be.false;
|
||||
isExtglob('a/b/c/[a-z].js').should.be.false;
|
||||
isExtglob('[a-j]*[^c]b/c').should.be.false;
|
||||
isExtglob('.').should.be.false;
|
||||
isExtglob('aa').should.be.false;
|
||||
isExtglob('abc.js').should.be.false;
|
||||
isExtglob('abc/def/ghi.js').should.be.false;
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in a new issue