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

@esbuild-plugins/node-resolve

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esbuild-plugins/node-resolve - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

6

CHANGELOG.md
# @esbuild-plugins/node-resolve
## 0.0.9
### Patch Changes
- 69e5c9c: Node resolve asyncResolve does not resolve to wrong extension
## 0.0.8

@@ -4,0 +10,0 @@

29

dist/index.js

@@ -73,3 +73,19 @@ "use strict";

var debug = require('debug')(NAME);
exports.resolveAsync = util_1.promisify(resolve_1.default);
var resolveAsync = function (id, opts) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, util_1.promisify(resolve_1.default)(id, opts)];
case 1:
result = _a.sent();
if (result &&
opts.extensions &&
!opts.extensions.includes(path_1.default.extname(result))) {
return [2 /*return*/];
}
return [2 /*return*/, result];
}
});
}); };
exports.resolveAsync = resolveAsync;
var isUsingYarnPnp = false;

@@ -194,6 +210,9 @@ try {

debug('onResolve');
return [2 /*return*/, {
path: resolved,
namespace: namespace,
}];
if (resolved) {
return [2 /*return*/, {
path: resolved,
namespace: namespace,
}];
}
return [2 /*return*/];
}

@@ -200,0 +219,0 @@ });

2

package.json
{
"name": "@esbuild-plugins/node-resolve",
"version": "0.0.8",
"version": "0.0.9",
"description": "",

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

@@ -15,3 +15,13 @@ import { OnResolveArgs, OnResolveResult, Plugin } from 'esbuild'

opts: AsyncOpts,
) => Promise<string | void> = promisify(resolve)
) => Promise<string | void> = async (id, opts) => {
const result = await promisify(resolve as any)(id, opts)
if (
result &&
opts.extensions &&
!opts.extensions.includes(path.extname(result))
) {
return
}
return result
}

@@ -138,5 +148,7 @@ interface Options {

debug('onResolve')
return {
path: resolved,
namespace,
if (resolved) {
return {
path: resolved,
namespace,
}
}

@@ -143,0 +155,0 @@ })

Sorry, the diff of this file is not supported yet

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