Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function complexItemTypeNames(spec: schema.CollectionProperty): string[] {
if (schema.isComplexListProperty(spec) || schema.isComplexMapProperty(spec)) {
return [spec.ItemType];
} else if (schema.isUnionProperty(spec)) {
return spec.ItemTypes || [];
}
return [];
}