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

glob-stream

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-stream - npm Package Compare versions

Comparing version 3.1.18 to 4.0.0

35

index.js

@@ -70,13 +70,25 @@ /*jslint node: true */

var positives = globs.filter(isPositive);
var negatives = globs.filter(isNegative);
var positives = [];
var negatives = [];
globs.forEach(function(glob, index) {
var globArray = isNegative(glob) ? negatives : positives;
globArray.push({
index: index,
glob: glob
});
});
if (positives.length === 0) throw new Error("Missing positive glob");
// only one positive glob no need to aggregate
if (positives.length === 1) return gs.createStream(positives[0], negatives, opt);
if (positives.length === 1) {
var negativeGlobs = negatives.filter(indexGreaterThan(positives[0].index)).map(toGlob);
return gs.createStream(positives[0].glob, negativeGlobs, opt);
}
// create all individual streams
var streams = positives.map(function(glob){
return gs.createStream(glob, negatives, opt);
var streams = positives.map(function(positive) {
var negativeGlobs = negatives.filter(indexGreaterThan(positive.index)).map(toGlob);
return gs.createStream(positive.glob, negativeGlobs, opt);
});

@@ -104,6 +116,2 @@

function isPositive(pattern) {
return !isNegative(pattern);
}
function unrelative(cwd, glob) {

@@ -118,3 +126,12 @@ var mod = '';

function indexGreaterThan(index) {
return function(obj) {
return obj.index > index;
};
}
function toGlob(obj) {
return obj.glob;
}
module.exports = gs;
{
"name": "glob-stream",
"description": "File system globs as a stream",
"version": "3.1.18",
"version": "4.0.0",
"homepage": "http://github.com/wearefractal/glob-stream",

@@ -6,0 +6,0 @@ "repository": "git://github.com/wearefractal/glob-stream.git",

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