is-extglob
Advanced tools
Comparing version 2.0.0 to 2.1.0
13
index.js
@@ -9,12 +9,13 @@ /*! | ||
module.exports = function isExtglob(str) { | ||
if (!str || typeof str !== 'string') { | ||
if (typeof str !== 'string' || str === '') { | ||
return false; | ||
} | ||
var m, matches = []; | ||
while ((m = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { | ||
if (m[2]) matches.push(m[2]); | ||
str = str.slice(m.index + m[0].length); | ||
var match; | ||
while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { | ||
if (match[2]) return true; | ||
str = str.slice(match.index + match[0].length); | ||
} | ||
return matches.length; | ||
return false; | ||
}; |
{ | ||
"name": "is-extglob", | ||
"description": "Returns true if a string has an extglob.", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"homepage": "https://github.com/jonschlinkert/is-extglob", | ||
@@ -13,5 +13,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"files": [ | ||
"index.js", | ||
"LICENSE", | ||
"README.md" | ||
"index.js" | ||
], | ||
@@ -59,5 +57,5 @@ "main": "index.js", | ||
"list": [ | ||
"has-glob", | ||
"is-glob", | ||
"micromatch", | ||
"has-glob" | ||
"micromatch" | ||
] | ||
@@ -64,0 +62,0 @@ }, |
@@ -107,2 +107,2 @@ # is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 03, 2016._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ |
6217