Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

findup

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

3

index.js

@@ -14,2 +14,3 @@ var fs = require('fs'),

if (dir === '/') return cb(new Error('not found'));
if(dir.indexOf('../../') !== -1 ) return cb(new Error(dir + ' is not correct.'));
iterator(dir, function(exists){

@@ -28,3 +29,5 @@ if(exists) return cb(null, dir);

}
var initialDir = dir;
while(dir !== '/'){
if(dir.indexOf('../../') !== -1 ) throw new Error(initialDir + ' is not correct.');
if(iteratorSync(dir)) return dir;

@@ -31,0 +34,0 @@ dir = Path.join(dir, '..');

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Walk up ancester's dir up to root",
"version": "0.1.0",
"version": "0.1.1",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -57,2 +57,12 @@ var vows = require('vows'),

'When findup in a bullshit dir': {
topic: function(fixtureDir){
findup('dsqkjfnqsdkjghq', 'toto.json', this.callback);
},
'Then an error is returned': function(err, file){
assert.isNotNull(err);
}
},
'When findup a file in ancestors dir in synchronous mode': {

@@ -90,4 +100,18 @@ topic: function(fixtureDir){

}
},
'When findup in a bullshit dir in synchronous mode': {
topic: function(fixtureDir){
try{
return findup.sync('uhjhbjkg,nfg', 'toto.json');
}catch(e){
return e;
}
},
'Then an error is returned': function(err){
assert.isNotNull(err);
}
}
}
}).exportTo(module);
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc