Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private renderCodeName(context: genspec.CodeName, type: genspec.CodeName): string {
const rel = type.relativeTo(context);
const specType = rel.specName && this.spec.PropertyTypes[rel.specName.fqn];
if (!specType || schema.isPropertyBag(specType)) {
return rel.fqn;
}
return this.findNativeType(context, specType);
}
private emitPropertyTypes(resourceName: string, resourceClass: genspec.CodeName): void {
const prefix = `${resourceName}.`;
for (const name of Object.keys(this.spec.PropertyTypes).sort()) {
if (!name.startsWith(prefix)) { continue; }
const cfnName = PropertyAttributeName.parse(name);
const propTypeName = genspec.CodeName.forPropertyType(cfnName, resourceClass);
const type = this.spec.PropertyTypes[name];
if (schema.isPropertyBag(type)) {
this.emitPropertyType(resourceClass, propTypeName, type);
}
}
}
visitScalar(type: genspec.CodeName) {
const specType = type.specName && self.spec.PropertyTypes[type.specName.fqn];
if (specType && !schema.isPropertyBag(specType)) {
return genspec.typeDispatch(resource, specType, this);
}
return genspec.validatorName(type).fqn;
},
visitUnionScalar(types: genspec.CodeName[]) {