Skip to content

Commit 34a9b5f

Browse files
authored
Fix are fields compatible (#484)
1 parent 14ee753 commit 34a9b5f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/utils/utils.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ export function isFunction(str) {
4343
return /\w+\([^)]*\)$/.test(str);
4444
}
4545

46-
export function areFieldsCompatible(db, field1, field2) {
47-
const same = field1.type === field2.type;
48-
if (dbToTypes[db][field1.type].compatibleWith) {
49-
return (
50-
dbToTypes[db][field1.type].compatibleWith.includes(field2.type) || same
51-
);
52-
}
53-
return same;
46+
export function areFieldsCompatible(db, field1Type, field2Type) {
47+
const same = field1Type === field2Type;
48+
const isCompatible =
49+
dbToTypes[db][field1Type].compatibleWith &&
50+
dbToTypes[db][field1Type].compatibleWith.includes(field2Type);
51+
return same || isCompatible;
5452
}
5553

5654
export function getTableHeight(table) {

0 commit comments

Comments
 (0)