Skip to content

Commit aa80be9

Browse files
committed
chore: simplify type guard
1 parent f82436b commit aa80be9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/core/src/utils/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,15 @@ export function block({
8484
}
8585

8686
export const getColumns = (output: Writable): number => {
87-
const withColumns = output as Writable & { columns?: number };
88-
if ('columns' in withColumns && typeof withColumns.columns === 'number') {
89-
return withColumns.columns;
87+
if ('columns' in output && typeof output.columns === 'number') {
88+
return output.columns;
9089
}
9190
return 80;
9291
};
9392

9493
export const getRows = (output: Writable): number => {
95-
const withRows = output as Writable & { rows?: number };
96-
if ('rows' in withRows && typeof withRows.rows === 'number') {
97-
return withRows.rows;
94+
if ('rows' in output && typeof output.rows === 'number') {
95+
return output.rows;
9896
}
9997
return 20;
10098
};

0 commit comments

Comments
 (0)