Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ApiModelGenerator.prototype._processApiTypeAlias = function(astDeclaration, exportedName, parentApiItem) {
console.log("ApiModelGenerator.prototype._processApiTypeAlias");
const name = !!exportedName ? exportedName : astDeclaration.astSymbol.localName;
const canonicalReference = ApiTypeAlias.getCanonicalReference(name);
let apiTypeAlias = /** @type {ApiTypeAlias?} */(parentApiItem.tryGetMember(canonicalReference));
if (apiTypeAlias === undefined) {
const typeAliasDeclaration = /** @type {ts.TypeAliasDeclaration} */(astDeclaration.declaration);
const nodesToCapture = [];
// @ts-ignore
const aliasTypeTokenRange = ExcerptBuilder.createEmptyTokenRange();
nodesToCapture.push({ node: typeAliasDeclaration.type, tokenRange: aliasTypeTokenRange });
const excerptTokens = ExcerptBuilder.build({
startingNode: astDeclaration.declaration,
nodesToCapture
});
// @ts-ignore
const docComment = this._collector.fetchMetadata(astDeclaration).tsdocComment;
// @ts-ignore
const releaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag;
// @ts-ignore
apiTypeAlias = new ApiTypeAlias({ name, docComment, releaseTag, excerptTokens, aliasTypeTokenRange });
parentApiItem.addMember(apiTypeAlias);
}
};