in src/validation/validateProperties.ts [14:33]
export default function (oneStateValueNode: ObjectASTNode, document: TextDocument): Diagnostic[] {
// Get the type of state
const stateType = findPropChildByName(oneStateValueNode, 'Type')?.valueNode?.value
const diagnostics: Diagnostic[] = []
if (typeof stateType === 'string') {
const hasCommonProperties = !!schema.StateTypes[stateType]?.hasCommonProperties
const stateProperties = schema.StateTypes[stateType]?.Properties
if (!stateProperties) {
return []
}
const allowedProperties = hasCommonProperties ? { ...schema.Common, ...stateProperties } : { ...stateProperties }
diagnostics.push(...getDiagnosticsForNode(oneStateValueNode, document, allowedProperties))
}
return diagnostics
}