How to use the @pnpm/npm-resolver/lib/parsePref function in @pnpm/npm-resolver

To help you get started, we’ve selected a few @pnpm/npm-resolver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / packages / resolve-dependencies / src / wantedDepIsLocallyAvailable.ts View on Github external
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
}

@pnpm/npm-resolver

Resolver for npm-hosted packages

MIT
Latest version published 7 days ago

Package Health Score

66 / 100
Full package analysis