Socket
Socket
Sign inDemoInstall

metro-runtime

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-runtime - npm Package Compare versions

Comparing version 0.76.2 to 0.76.3

2

package.json
{
"name": "metro-runtime",
"version": "0.76.2",
"version": "0.76.3",
"description": "🚇 Module required for evaluating Metro bundles.",

@@ -5,0 +5,0 @@ "main": "src",

@@ -0,1 +1,3 @@

"use strict";
/**

@@ -7,12 +9,38 @@ * Copyright (c) Meta Platforms, Inc. and affiliates.

*
*
* @format
*
* @oncall react_native
*/
"use strict";
// $FlowExpectedError Flow does not know about Metro's require extensions.
const dynamicRequire = require;
module.exports = function (moduleID) {
return Promise.resolve().then(() => dynamicRequire.importAll(moduleID));
const DEFAULT_OPTIONS = {
isPrefetchOnly: false,
};
async function asyncRequireImpl(moduleID, paths, options) {
const loadBundle = global[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`];
if (loadBundle != null) {
const stringModuleID = String(moduleID);
if (paths != null) {
const bundlePath = paths[stringModuleID];
if (bundlePath != null) {
// NOTE: Errors will be swallowed by asyncRequire.prefetch
await loadBundle(bundlePath);
}
}
}
if (!options.isPrefetchOnly) {
return require.importAll(moduleID);
}
return undefined;
}
async function asyncRequire(moduleID, paths, moduleName) {
return asyncRequireImpl(moduleID, paths, DEFAULT_OPTIONS);
}
asyncRequire.prefetch = function (moduleID, paths, moduleName) {
asyncRequireImpl(moduleID, paths, {
isPrefetchOnly: true,
}).then(
() => {},
() => {}
);
};
module.exports = asyncRequire;

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