Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function wantedDepIsLocallyAvailable (
workspacePackages: WorkspacePackages,
wantedDependency: WantedDependency,
opts: {
defaultTag: string,
registry: string,
},
) {
const spec = parsePref(wantedDependency.pref, wantedDependency.alias, opts.defaultTag || 'latest', opts.registry)
if (!spec || !workspacePackages[spec.name]) return false
return pickMatchingLocalVersionOrNull(workspacePackages[spec.name], spec) !== null
}