Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
root =
localDependencyRoot ||
resolveNodeModuleDir(projectRoot, dependencyName);
const output = readDependencyConfigFromDisk(root);
config = output.config;
if (output.legacy && !localDependencyRoot) {
const pkg = require(path.join(root, 'package.json'));
const link =
pkg.homepage || `https://npmjs.com/package/${dependencyName}`;
depsWithWarnings.push([dependencyName, link]);
}
} catch (error) {
logger.warn(
inlineString(`
Package ${chalk.bold(
dependencyName,
)} has been ignored because it contains invalid configuration.
Reason: ${chalk.dim(error.message)}`),
);
return acc;
}
const isPlatform = Object.keys(config.platforms).length > 0;
/**
* Legacy `rnpm` config required `haste` to be defined. With new config,
* we do it automatically.
*
* @todo: Remove this once `rnpm` config is deprecated and all major RN libs are converted.