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]
|
||||||
return true
|
if (isObject && hasOverrides(value, existing || {})) {
|
||||||
}
|
|
||||||
} else if (value !== existingObj[key]) {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
if (!isObject && value !== existing) {
|
||||||
return false
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
const table = await sdk.tables.getTable(view.tableId)
|
const table = await sdk.tables.getTable(view.tableId)
|
||||||
|
|
Loading…
Reference in New Issue