From f11fcaa634d5dff08dc754f4290442498be7cc9c Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 31 Mar 2022 20:03:18 +0200 Subject: [PATCH] refactor(@angular/cli): remove coercion from `packages` positional configuration Configure the `packages` positional argument to be an array instead of using `coerce` method. --- packages/angular/cli/src/commands/update/cli.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/angular/cli/src/commands/update/cli.ts b/packages/angular/cli/src/commands/update/cli.ts index c00d61ece2..c5e7e88390 100644 --- a/packages/angular/cli/src/commands/update/cli.ts +++ b/packages/angular/cli/src/commands/update/cli.ts @@ -70,7 +70,8 @@ export class UpdateCommandModule extends CommandModule { return localYargs .positional('packages', { description: 'The names of package(s) to update.', - coerce: (value) => (typeof value === 'string' ? [value] : value) as string[] | undefined, + type: 'string', + array: true, }) .option('force', { description: @@ -872,15 +873,12 @@ export class UpdateCommandModule extends CommandModule { * @returns the version to install or null when there is no update to install. */ private async checkCLIVersion( - packagesToUpdate: string[] | string | undefined, + packagesToUpdate: string[] | undefined, verbose = false, next = false, ): Promise { const { version } = await fetchPackageManifest( - `@angular/cli@${this.getCLIUpdateRunnerVersion( - typeof packagesToUpdate === 'string' ? [packagesToUpdate] : packagesToUpdate, - next, - )}`, + `@angular/cli@${this.getCLIUpdateRunnerVersion(packagesToUpdate, next)}`, this.context.logger, { verbose,