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

confortable

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confortable - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

19

confortable.js

@@ -5,14 +5,17 @@ var fs = require('fs')

module.exports = function (name, cwd) {
var cfg;
module.exports = function (name, start) {
start = start || process.cwd();
var relative = path.relative(process.env.HOME, start)
, differentDrive = (relative === start)
, isAbove = (relative.slice(0, 2) === '..')
, cfg;
cwd = cwd || process.cwd();
if (path.relative(process.env.HOME, cwd).slice(0, 2) === '..') {
// cwd is outside home, check cwd only
cfg = path.join(cwd, name);
if (differentDrive || isAbove) {
// start is outside home, check start only
cfg = path.join(start, name);
return exists(cfg) ? cfg : null;
}
else {
// cwd is somewhere under HOME start in cwd and go up until we hit HOME
var dir = cwd;
// start is somewhere under HOME start, so start there and go up until we hit HOME
var dir = start;
while (path.relative(process.env.HOME, dir).slice(0, 2) !== '..') {

@@ -19,0 +22,0 @@ cfg = path.join(dir, name);

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

"description": "Finds the right recursively placed config file",
"version": "0.1.1",
"version": "0.1.2",
"repository": {

@@ -8,0 +8,0 @@ "type": "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