Remove unnecessary "in" checks

This commit is contained in:
Adria Navarro 2025-01-31 13:28:38 +01:00
parent 884895060b
commit 141fc902c3
1 changed files with 3 additions and 6 deletions

View File

@ -136,11 +136,8 @@ function getMissingRequiredSettings(
const result: Record<string, UIComponentError[]> = {} const result: Record<string, UIComponentError[]> = {}
for (const component of allComponents) { for (const component of allComponents) {
const definition = definitions[component._component] const definition = definitions[component._component]
if (!("settings" in definition)) {
continue
}
const missingRequiredSettings = definition.settings?.filter( const missingRequiredSettings = definition?.settings?.filter(
(setting: any) => { (setting: any) => {
let empty = let empty =
component[setting.key] == null || component[setting.key] === "" component[setting.key] == null || component[setting.key] === ""
@ -258,10 +255,10 @@ function findComponentsBySettingsType(
const setting = definition?.settings?.find((s: any) => const setting = definition?.settings?.find((s: any) =>
typesArray.includes(s.type) typesArray.includes(s.type)
) )
if (setting && "type" in setting) { if (setting) {
result.push({ result.push({
component, component,
setting: { type: setting.type!, key: setting.key! }, setting: { type: setting.type, key: setting.key },
}) })
} }
component._children?.forEach(child => { component._children?.forEach(child => {