Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function complexScalarTypeNames(spec: schema.ScalarProperty): string[] {
if (schema.isComplexProperty(spec) && !schema.isListProperty(spec) && !schema.isMapProperty(spec)) {
return [spec.Type];
} else if (schema.isUnionProperty(spec)) {
return spec.Types || [];
}
return [];
}
function primitiveScalarTypeNames(spec: schema.ScalarProperty): string[] {
if (schema.isPrimitiveProperty(spec)) {
return [spec.PrimitiveType];
} else if (schema.isUnionProperty(spec)) {
return spec.PrimitiveTypes || [];
}
return [];
}
function primitiveItemTypeNames(spec: schema.CollectionProperty): string[] {
if (schema.isPrimitiveListProperty(spec) || schema.isPrimitiveMapProperty(spec)) {
return [spec.PrimitiveItemType];
} else if (schema.isUnionProperty(spec)) {
return spec.PrimitiveItemTypes || [];
}
return [];
}
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 [];
}