is-valid-glob
Advanced tools
Comparing version 0.1.0 to 0.2.0
'use strict'; | ||
module.exports = function isValidGlob(glob) { | ||
if (typeof glob === 'string') { | ||
if (typeof glob === 'string' && glob.length > 0) { | ||
return true; | ||
@@ -16,3 +16,3 @@ } | ||
while (len--) { | ||
if (typeof arr[len] !== 'string') { | ||
if (typeof arr[len] !== 'string' || arr[len].length <= 0) { | ||
return false; | ||
@@ -19,0 +19,0 @@ } |
{ | ||
"name": "is-valid-glob", | ||
"description": "Return true if a value is a valid glob pattern.", | ||
"version": "0.1.0", | ||
"description": "Return true if a value is a valid glob pattern or patterns.", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/jonschlinkert/is-valid-glob", | ||
@@ -22,3 +22,2 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -39,2 +38,2 @@ "mocha": "*" | ||
] | ||
} | ||
} |
# is-valid-glob [![NPM version](https://badge.fury.io/js/is-valid-glob.svg)](http://badge.fury.io/js/is-valid-glob) | ||
> Return true if a value is a valid glob pattern. | ||
> Return true if a value is a valid glob pattern or patterns. | ||
@@ -31,3 +31,2 @@ This really just checks to make sure that a pattern is either a string or array, and if it's an array it's either empty or consists of only strings. | ||
isValidGlob(['a', 'b']); | ||
isValidGlob(''); | ||
isValidGlob([]); | ||
@@ -41,2 +40,3 @@ //=> all true | ||
isValidGlob(); | ||
isValidGlob(''); | ||
isValidGlob({}); | ||
@@ -49,2 +49,3 @@ isValidGlob(null); | ||
isValidGlob(['foo', {}]); | ||
isValidGlob(['']); | ||
//=> all false | ||
@@ -87,2 +88,2 @@ ``` | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 01, 2015._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 07, 2015._ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4750
85