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

directory-walker

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

directory-walker - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

23

lib/directory-walker/directory-walker.js

@@ -9,4 +9,3 @@ // third-party dependencies

events.EventEmitter.call(this);
this.basedir = config.basedir;
this.onFile = config.onFile;

@@ -17,6 +16,7 @@ this.onDirectory = config.onDirectory;

if (config.excludes) {
this.excludes = {};
this._excludesMap = {};
for (var i = 0; i < config.excludes.length; i++) {
var exclude = path.resolve(config.excludes[i]);
this.excludes[exclude] = true;
this._excludesMap[exclude] = true;
}

@@ -38,6 +38,3 @@ }

DirectoryWalker.prototype.walk = function(dir) {
// right before we read directory, we increment pending
// right after directory is read, we decrement pending
// when pending drops back to zero then we are down walking
this.readdir(dir || this.basedir);
this.visit(dir);
};

@@ -49,2 +46,6 @@

DirectoryWalker.prototype.isExplicitExclude = function(path) {
return this._excludesMap && this._excludesMap[path];
};
DirectoryWalker.prototype.visit = function(file, parent) {

@@ -77,3 +78,3 @@ var self = this;

var dir = path.resolve(dir);
if (this.excludes && this.excludes[dir]) {
if (this._excludesMap && this._excludesMap[dir]) {
return;

@@ -99,3 +100,3 @@ }

var file = path.resolve(dir + '/' + files[i]);
if (!this.excludes || !this.excludes[dir]) {
if (!this._excludesMap || !this._excludesMap[dir]) {
self.visit(file, dir);

@@ -118,3 +119,3 @@ }

var walker = new DirectoryWalker(options);
walker.start();
walker.walk(options.basedir);
}
{
"name": "directory-walker",
"description": "Directory walker",
"version": "1.1.0",
"version": "1.2.0",
"homepage": "https://github.com/philidem/node-directory-walker",

@@ -6,0 +6,0 @@ "authors": [

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