shrine-medco/shrine-webclient/src/main/html/node_modules/is-glob4030fe44ffe8riccardo
README.md
is-glob ![NPM version](http://badge.fury.io/js/is-glob) ![Build Status](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.
Also take a look at is-valid-glob and has-glob.
Install
Install with npm
sh $ npm i is-glob --save
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
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):
js isGlob(['**/*.js']); isGlob(['foo.js']); //=> false
Related
- has-glob: Returns true if an array has a glob pattern. | homepage
- is-extglob: Returns true if a string has an extglob. | homepage
- is-posix-bracket: Returns true if the given string is a POSIX bracket expression (POSIX character class). | 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. Just… more | homepage
Run tests
Install dev dependencies:
sh $ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
+ github/jonschlinkert + twitter/jonschlinkert
License
Copyright © 2015 Jon Schlinkert Released under the MIT license.
_This file was generated by verb-cli on October 02, 2015._