Comparing version 0.1.1 to 0.1.2
@@ -10,2 +10,4 @@ var map = require('map-stream'); | ||
module.exports = function(outFolder, opt) { | ||
if (typeof outFolder !== 'string') throw new Error('Invalid output folder'); | ||
if (!opt) opt = {}; | ||
@@ -12,0 +14,0 @@ if (!opt.cwd) opt.cwd = process.cwd(); |
@@ -8,3 +8,12 @@ var map = require('map-stream'); | ||
var validateGlob = function(glob) { | ||
var isArr = Array.isArray(glob); | ||
if (typeof glob !== 'string' && !isArr) return false; | ||
if (isArr && isArr.length === 0) return false; | ||
return true; | ||
}; | ||
module.exports = function(glob, opt) { | ||
if (!validateGlob(glob)) throw new Error('Invalid glob pattern'); | ||
if (!opt) opt = {}; | ||
@@ -11,0 +20,0 @@ if (typeof opt.read !== 'boolean') opt.read = true; |
{ | ||
"name": "vinyl-fs", | ||
"description": "Vinyl adapter for the file system", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "http://github.com/wearefractal/vinyl-fs", | ||
@@ -12,3 +12,3 @@ "repository": "git://github.com/wearefractal/vinyl-fs.git", | ||
"glob-stream": "^3.1.5", | ||
"glob-watcher": "^0.0.3", | ||
"glob-watcher": "^0.0.4", | ||
"mkdirp": "^0.3.5", | ||
@@ -15,0 +15,0 @@ "graceful-fs": "^2.0.1", |
@@ -33,2 +33,13 @@ var vfs = require('../'); | ||
it('should explode on invalid folder', function(done) { | ||
var stream; | ||
try { | ||
stream = gulp.dest(); | ||
} catch (err) { | ||
should.exist(err); | ||
should.not.exist(stream); | ||
done(); | ||
} | ||
}); | ||
it('should pass through writes with cwd', function(done) { | ||
@@ -35,0 +46,0 @@ var inputPath = path.join(__dirname, "./fixtures/test.coffee"); |
@@ -22,2 +22,35 @@ var vfs = require('../'); | ||
it('should explode on invalid glob (empty)', function(done) { | ||
var stream; | ||
try { | ||
stream = gulp.src(); | ||
} catch (err) { | ||
should.exist(err); | ||
should.not.exist(stream); | ||
done(); | ||
} | ||
}); | ||
it('should explode on invalid glob (number)', function(done) { | ||
var stream; | ||
try { | ||
stream = gulp.src(123); | ||
} catch (err) { | ||
should.exist(err); | ||
should.not.exist(stream); | ||
done(); | ||
} | ||
}); | ||
it('should explode on invalid glob (empty array)', function(done) { | ||
var stream; | ||
try { | ||
stream = gulp.src([]); | ||
} catch (err) { | ||
should.exist(err); | ||
should.not.exist(stream); | ||
done(); | ||
} | ||
}); | ||
it('should pass through writes', function(done) { | ||
@@ -24,0 +57,0 @@ var expectedPath = path.join(__dirname, "./fixtures/test.coffee"); |
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
26614
593
+ Addedgaze@0.5.2(transitive)
+ Addedglob-watcher@0.0.4(transitive)
- Removedgaze@0.4.3(transitive)
- Removedglob-watcher@0.0.3(transitive)
Updatedglob-watcher@^0.0.4