New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sprucelabs/path-resolver

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sprucelabs/path-resolver - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1-prerelease-dir-index.1

25

build/PathResolver.js

@@ -194,10 +194,25 @@ "use strict";

for (const candidate of candidates) {
let pathIsDirectory = false;
try {
pathIsDirectory = fs_1.default.lstatSync(candidate).isDirectory();
}
catch (e) {
log_1.default.trace(e);
}
for (const ext of this.extensions) {
const fullPath = candidate + ext;
attemptedPaths.push(fullPath);
if (fs_1.default.existsSync(fullPath)) {
log_1.default.info(`${request} mapped to -> ${fullPath}`);
this.pathCache[request] = fullPath;
return fullPath;
const pathsToAttempt = [fullPath];
// Check for index file if it's a path
if (pathIsDirectory) {
pathsToAttempt.push(path.join(candidate, `index${ext}`));
}
for (let i = 0; i < pathsToAttempt.length; i += 1) {
const pathToAttempt = pathsToAttempt[i];
attemptedPaths.push(pathToAttempt);
if (fs_1.default.existsSync(pathToAttempt)) {
log_1.default.info(`${request} mapped to -> ${pathToAttempt}`);
this.pathCache[request] = pathToAttempt;
return pathToAttempt;
}
}
}

@@ -204,0 +219,0 @@ }

2

package.json

@@ -10,3 +10,3 @@ {

],
"version": "1.3.0",
"version": "1.3.1-prerelease-dir-index.1",
"main": "./build/index.js",

@@ -13,0 +13,0 @@ "types": "./build/index.d.ts",

Sorry, the diff of this file is not supported yet

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