Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/angular/cli/src/utilities/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import { memoize } from './memoize';
/**
* A map of package managers to their corresponding lockfile names.
*/
const LOCKFILE_NAMES: Readonly<Record<PackageManager, string | readonly string[]>> = {
const LOCKFILE_NAMES: Readonly<
Record<Exclude<PackageManager, PackageManager.Cnpm>, string | readonly string[]>
> = {
[PackageManager.Yarn]: 'yarn.lock',
[PackageManager.Pnpm]: 'pnpm-lock.yaml',
[PackageManager.Bun]: ['bun.lockb', 'bun.lock'],
Expand Down Expand Up @@ -289,7 +291,10 @@ export class PackageManagerUtils {
* @param filesInRoot An array of file names in the root directory.
* @returns True if the lockfile exists, false otherwise.
*/
private hasLockfile(packageManager: PackageManager, filesInRoot: string[]): boolean {
private hasLockfile(
packageManager: Exclude<PackageManager, PackageManager.Cnpm>,
filesInRoot: string[],
): boolean {
const lockfiles = LOCKFILE_NAMES[packageManager];

return typeof lockfiles === 'string'
Expand Down