Clean code
This commit is contained in:
parent
624dc5ff26
commit
76cacfaff0
|
@ -18,16 +18,18 @@ async function parseSchemaUI(ctx: Ctx, view: CreateViewRequest) {
|
||||||
newObj: Record<string, any>,
|
newObj: Record<string, any>,
|
||||||
existingObj: Record<string, any>
|
existingObj: Record<string, any>
|
||||||
) {
|
) {
|
||||||
for (const [key, value] of Object.entries(newObj)) {
|
const result = Object.entries(newObj).some(([key, value]) => {
|
||||||
if (typeof value === "object") {
|
const isObject = typeof value === "object"
|
||||||
if (hasOverrides(value, existingObj[key] || {})) {
|
const existing = existingObj[key]
|
||||||
|
if (isObject && hasOverrides(value, existing || {})) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
} else if (value !== existingObj[key]) {
|
if (!isObject && value !== existing) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
return false
|
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
const table = await sdk.tables.getTable(view.tableId)
|
const table = await sdk.tables.getTable(view.tableId)
|
||||||
|
|
Loading…
Reference in New Issue