Skip to content

Commit d0d5fbb

Browse files
committed
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.
1 parent d480124 commit d0d5fbb

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎packages/angular_devkit/schematics_cli/bin/schematics.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,12 @@ export async function main({
335335
break;
336336
case 'update':
337337
loggingQueue.push(
338-
// TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution.
339-
`${styleText(['cyan'], 'UPDATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`,
338+
`${styleText(['cyan'], 'UPDATE')} ${eventPath} (${event.content.byteLength} bytes)`,
340339
);
341340
break;
342341
case 'create':
343342
loggingQueue.push(
344-
// TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution.
345-
`${styleText(['green'], 'CREATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`,
343+
`${styleText(['green'], 'CREATE')} ${eventPath} (${event.content.byteLength} bytes)`,
346344
);
347345
break;
348346
case 'delete':

0 commit comments

Comments
 (0)