Socket
Socket
Sign inDemoInstall

metro-resolver

Package Overview
Dependencies
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-resolver - npm Package Compare versions

Comparing version 0.31.0 to 0.32.0

2

package.json
{
"version": "0.31.0",
"version": "0.32.0",
"name": "metro-resolver",

@@ -4,0 +4,0 @@ "description": "🚇 Metro resolution logic",

@@ -28,2 +28,3 @@ /**

const Resolver = {

@@ -30,0 +31,0 @@ FailedToResolveNameError: require('./FailedToResolveNameError'),

@@ -37,2 +37,4 @@ /**

function resolve(

@@ -43,5 +45,9 @@ context,

{
if (isRelativeImport(moduleName) || isAbsolutePath(moduleName)) {
if (
!context.resolveRequest && (
isRelativeImport(moduleName) || isAbsolutePath(moduleName)))
{
return resolveModulePath(context, moduleName, platform);
}
const realModuleName = context.redirectModulePath(moduleName);

@@ -54,3 +60,6 @@ // exclude

originModulePath = context.originModulePath;
if (isRelativeImport(realModuleName) || isAbsolutePath(realModuleName)) {
if (
!context.resolveRequest && (
isRelativeImport(realModuleName) || isAbsolutePath(realModuleName)))
{
// derive absolute path /.../node_modules/originModuleDir/realModuleName

@@ -67,4 +76,14 @@ const fromModuleParentIdx =

// At that point we only have module names that
// aren't relative paths nor absolute paths.
if (context.resolveRequest) {
try {
const resolution = context.resolveRequest(
moduleName,
context.originModulePath);
if (resolution) {
return { type: 'sourceFile', filePath: resolution };
}
} catch (error) {}
}
if (context.allowHaste) {

@@ -71,0 +90,0 @@ const normalizedName = normalizePath(realModuleName);

Sorry, the diff of this file is not supported yet

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