Returns `true` if an array has a glob pattern.
npm install has-glob> Returns true if an array has a glob pattern.
Install with npm:
``sh`
$ npm install --save has-glob
`js
var hasGlob = require('has-glob');
hasGlob(['foo', 'bar', '*.js']);
//=> true
hasGlob(['foo', 'bar', 'baz']);
//=> false
`
True
The following all return true:
`js`
hasGlob(['foo', 'bar', '*.js'])
hasGlob(['foo', 'bar', '!*.js'])
hasGlob(['foo', 'bar', '!foo'])
hasGlob(['foo', 'bar', '!foo.js'])
hasGlob(['foo', 'bar', '**/abc.js'])
hasGlob(['foo', 'bar', 'abc/*.js'])
hasGlob(['foo', 'bar', 'abc/{a,b}.js'])
hasGlob(['foo', 'bar', 'abc/{a..z}.js'])
hasGlob(['foo', 'bar', 'abc/{a..z..2}.js'])
hasGlob(['foo', 'bar', 'abc/@(a).js'])
hasGlob(['foo', 'bar', 'abc/!(a).js'])
hasGlob(['foo', 'bar', 'abc/+(a).js'])
hasGlob(['foo', 'bar', 'abc/*(a).js'])
hasGlob(['foo', 'bar', 'abc/?(a).js'])
hasGlob(['foo', 'bar', 'abc/@.js'])
hasGlob(['foo', 'bar', 'abc/!.js'])
hasGlob(['foo', 'bar', 'abc/+.js'])
hasGlob(['foo', 'bar', 'abc/*.js'])
hasGlob(['foo', 'bar', 'abc/?.js'])
hasGlob(['foo', 'bar', 'abc/(aaa|bbb).js'])
hasGlob(['foo', 'bar', 'abc/?.js'])
hasGlob(['foo', 'bar', '?.js'])
hasGlob(['foo', 'bar', '[abc].js'])
hasGlob(['foo', 'bar', '[^abc].js'])
hasGlob(['foo', 'bar', 'a/b/c/[a-z].js'])
hasGlob(['foo', 'bar', '[a-j]*[^c]b/c'])
//=> true
Also works with strings:
`js`
hasGlob('*.js')
hasGlob('!*.js')
hasGlob('!foo')
hasGlob('!foo.js')
hasGlob('**/abc.js')
hasGlob('abc/*.js')
//=> true
False
The following all return false:
`js`
hasGlob([])
hasGlob([null])
hasGlob([undefined])
hasGlob([{}])
hasGlob(['.'])
hasGlob(['foo', 'bar', 'aa'])
hasGlob(['foo', 'bar', 'abc.js'])
hasGlob(['foo', 'bar', 'abc/def/ghi.js'])
//=> false
* has-glob: Returns true if an array has a glob pattern. | truetrue if an array has a glob pattern."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* is-glob: Returns if the given string looks like a glob pattern or an extglob pattern… more | truenegated 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 bet"" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* is-negated-glob: Returns an object with a boolean and the ! stripped from negation patterns. Also… more | negated boolean and the ! stripped from negation patterns. Also respects extglobs."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* is-valid-glob: Return true if a value is a valid glob pattern or patterns. | homepage
* micromatch: Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
_(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)_
To generate the readme and API documentation with verb:
`sh`
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
`sh``
$ npm install -d && npm test
Jon Schlinkert
* github/jonschlinkert
* twitter/jonschlinkert
Copyright © 2016, Jon Schlinkert.
Released under the MIT license.
*
_This file was generated by verb-generate-readme, v0.1.30, on September 08, 2016._