Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vinyl-fs

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinyl-fs - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

lib/dest/index.js

@@ -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;

4

package.json
{
"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");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc