Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function tagType(resource: schema.ResourceType): string {
if (schema.isTaggableResource(resource)) {
const prop = resource.Properties.Tags;
if (schema.isTagPropertyStandard(prop)) {
return `${TAG_TYPE}.STANDARD`;
}
if (schema.isTagPropertyAutoScalingGroup(prop)) {
return `${TAG_TYPE}.AUTOSCALING_GROUP`;
}
if (schema.isTagPropertyJson(prop) || schema.isTagPropertyStringMap(prop)) {
return `${TAG_TYPE}.MAP`;
}
}
return `${TAG_TYPE}.NOT_TAGGABLE`;
}