refactor(editor): remove assert functions (#10629)

This commit is contained in:
Saul-Mirone
2025-03-05 10:20:02 +00:00
parent 201c3438ba
commit 7e39893aac
17 changed files with 63 additions and 95 deletions

View File

@@ -1,5 +1,5 @@
import { ShadowlessElement } from '@blocksuite/block-std';
import { assertEquals } from '@blocksuite/global/utils';
import { isEqual } from '@blocksuite/global/utils';
import { type Text } from '@blocksuite/store';
import { css, html } from 'lit';
import { state } from 'lit/decorators.js';
@@ -63,11 +63,10 @@ export function fillSelectionWithFocusCellData(
if (!focusCell) return;
if (rowsSelection && columnsSelection) {
assertEquals(
columnsSelection.start,
columnsSelection.end,
'expected selections on a single column'
);
if (!isEqual(columnsSelection.start, columnsSelection.end)) {
console.error('expected selections on a single column');
return;
}
const curCol = focusCell.column; // we are sure that we are always in the same column while iterating through rows
const cell = focusCell.cell$.value;