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

broccoli-content-funnel

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-content-funnel - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

31

index.js

@@ -6,3 +6,5 @@ 'use strict';

const denodeify = require('denodeify');
const readFile = denodeify(require('fs').readFile);
const fs = require('fs');
const readFile = denodeify(fs.readFile);
const realpath = denodeify(fs.realpath);

@@ -37,10 +39,15 @@ class ContentFunnel extends Funnel {

.on('data', item => {
if (item.stats.isDirectory()) {
return;
}
let promise;
if (type === 'function') {
promise = Promise.resolve(this.options[option](item.path));
} else {
promise = readFile(item.path, 'utf8').then(source => {
promises.push(Promise.resolve().then(() => {
if (item.stats.isSymbolicLink()) {
return realpath(item.path);
}
return item.path;
}).then(filePath => {
if (item.stats.isDirectory()) {
return;
}
if (type === 'function') {
return this.options[option](filePath);
}
return readFile(filePath, 'utf8').then(source => {
if (type === 'string') {

@@ -51,9 +58,7 @@ return source.indexOf(this.options[option]) !== -1;

});
}
promise = promise.then(result => {
}).then(result => {
if (result) {
this[option].push(item.path.substr(inputPath.length + 1));
}
});
promises.push(promise);
}));
})

@@ -60,0 +65,0 @@ .on('end', () => {

{
"name": "broccoli-content-funnel",
"version": "0.0.1",
"version": "0.0.2",
"description": "Funnel based on file contents",

@@ -5,0 +5,0 @@ "main": "index.js",

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