-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui5-table): remove circular dependency from table and row (#9261)
- remove cyclic import in TableRowBase of Table.ts - add TableUtils.ts, which adds duck-typed instanceof checks for safe imports
- Loading branch information
Showing
5 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type Table from "./Table"; | ||
import type TableCellBase from "./TableCellBase"; | ||
import type TableRowBase from "./TableRowBase"; | ||
|
||
const isInstanceOfTable = (obj: any): obj is Table => { | ||
return "isTable" in obj && !!obj.isTable; | ||
}; | ||
|
||
const isInstanceOfTableCellBase = (obj: any): obj is TableCellBase => { | ||
return "isTableCellBase" in obj && !!obj.isTableCellBase; | ||
}; | ||
|
||
const isInstanceOfTableRowBase = (obj: any): obj is TableRowBase => { | ||
return "isTableRowBase" in obj && !!obj.isTableRowBase; | ||
}; | ||
|
||
export { | ||
isInstanceOfTable, | ||
isInstanceOfTableCellBase, | ||
isInstanceOfTableRowBase, | ||
}; |