Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (res && isSource) {
isValid = true;
resource = res;
loadedSource = source;
return true;
}
if (res && !isSource) { // Paths to sources might not have packages and versioning doesn't apply
debug(`${name} found in ${source}`);
if (source === currentProcessDir) {
try {
const packageConfig = loadPackage(source);
if (!normalizeIncludes(packageConfig.name, packageName)) {
return false;
}
} catch (e) {
return false;
}
}
if (verifyVersion && !isVersionValid(source)) {
debug(`Resource ${name} isn't compatible with current hint version`);
isValid = false;
return false;
}
isValid = true;