From d480124a331614b7d2cb0e9e94161e3e73b900e6 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:44:08 +0000 Subject: [PATCH 1/2] refactor(@angular/cli): use ArrayBufferLike.byteLength for dry run event content Use event.content.byteLength instead of casting ArrayBufferLike to Buffer to access length. --- .../command-builder/utilities/schematic-workflow.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts b/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts index c4134ef8ce66..8830454356ea 100644 --- a/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts +++ b/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts @@ -38,17 +38,11 @@ export function subscribeToWorkflow( ); break; case 'update': - logs.push( - // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. - `${colors.cyan('UPDATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, - ); + logs.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.byteLength} bytes)`); files.add(eventPath); break; case 'create': - logs.push( - // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. - `${colors.green('CREATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, - ); + logs.push(`${colors.green('CREATE')} ${eventPath} (${event.content.byteLength} bytes)`); files.add(eventPath); break; case 'delete': From d0d5fbb36184436a5c3fdf66b1fef27b19cbde6b Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:44:23 +0000 Subject: [PATCH 2/2] refactor(@angular-devkit/schematics-cli): use ArrayBufferLike.byteLength for dry run event content Use event.content.byteLength instead of casting ArrayBufferLike to Buffer to access length. --- packages/angular_devkit/schematics_cli/bin/schematics.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/angular_devkit/schematics_cli/bin/schematics.ts b/packages/angular_devkit/schematics_cli/bin/schematics.ts index 91a658d0ced8..f07e6a93e5ab 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics.ts @@ -335,14 +335,12 @@ export async function main({ break; case 'update': loggingQueue.push( - // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. - `${styleText(['cyan'], 'UPDATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + `${styleText(['cyan'], 'UPDATE')} ${eventPath} (${event.content.byteLength} bytes)`, ); break; case 'create': loggingQueue.push( - // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. - `${styleText(['green'], 'CREATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + `${styleText(['green'], 'CREATE')} ${eventPath} (${event.content.byteLength} bytes)`, ); break; case 'delete':