Skip to content

Commit 0a60ce5

Browse files
alan-agius4dgp1130
authored andcommitted
refactor(@angular/cli): use ArrayBufferLike.byteLength for dry run event content
Use event.content.byteLength instead of casting ArrayBufferLike to Buffer to access length. (cherry picked from commit 7882ed0)
1 parent e91c414 commit 0a60ce5

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

‎packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,11 @@ export function subscribeToWorkflow(
3838
);
3939
break;
4040
case 'update':
41-
logs.push(
42-
// TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution.
43-
`${colors.cyan('UPDATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`,
44-
);
41+
logs.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.byteLength} bytes)`);
4542
files.add(eventPath);
4643
break;
4744
case 'create':
48-
logs.push(
49-
// TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution.
50-
`${colors.green('CREATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`,
51-
);
45+
logs.push(`${colors.green('CREATE')} ${eventPath} (${event.content.byteLength} bytes)`);
5246
files.add(eventPath);
5347
break;
5448
case 'delete':

0 commit comments

Comments
 (0)