.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / fast-glob / node_modules / glob-parent / node_modules / is-glob / index.js
1 /*!
2  * is-glob <https://github.com/jonschlinkert/is-glob>
3  *
4  * Copyright (c) 2014-2016, Jon Schlinkert.
5  * Licensed under the MIT License.
6  */
7
8 var isExtglob = require('is-extglob');
9
10 module.exports = function isGlob(str) {
11   if (typeof str !== 'string' || str === '') {
12     return false;
13   }
14
15   if (isExtglob(str)) return true;
16
17   var regex = /(\\).|([*?]|\[.*\]|\{.*\}|\(.*\|.*\)|^!)/;
18   var match;
19
20   while ((match = regex.exec(str))) {
21     if (match[2]) return true;
22     str = str.slice(match.index + match[0].length);
23   }
24   return false;
25 };