Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private static _shouldIncludeReleaseTag(releaseTag: ReleaseTag, dtsKind: DtsRollupKind): boolean {
switch (dtsKind) {
case DtsRollupKind.InternalRelease:
return true;
case DtsRollupKind.BetaRelease:
// NOTE: If the release tag is "None", then we don't have enough information to trim it
return (
releaseTag === ReleaseTag.Beta || releaseTag === ReleaseTag.Public || releaseTag === ReleaseTag.None
);
case DtsRollupKind.PublicRelease:
return releaseTag === ReleaseTag.Public || releaseTag === ReleaseTag.None;
}
throw new Error(`${DtsRollupKind[dtsKind]} is not implemented`);
}
}const remarks: string = this._renderMarkdown(tsdocComment.remarksBlock.content, apiItem);
if (remarks) {
yamlItem.remarks = remarks;
}
}
if (tsdocComment.deprecatedBlock) {
const deprecatedMessage: string = this._renderMarkdown(tsdocComment.deprecatedBlock.content, apiItem);
if (deprecatedMessage.length > 0) {
yamlItem.deprecated = { content: deprecatedMessage };
}
}
}
if (ApiReleaseTagMixin.isBaseClassOf(apiItem)) {
if (apiItem.releaseTag === ReleaseTag.Beta) {
yamlItem.isPreview = true;
}
}
yamlItem.name = this._getYamlItemName(apiItem);
yamlItem.fullName = yamlItem.name;
yamlItem.langs = ['typeScript'];
switch (apiItem.kind) {
case ApiItemKind.Enum:
yamlItem.type = 'enum';
break;
case ApiItemKind.EnumMember:
yamlItem.type = 'field';
const enumMember: ApiEnumMember = apiItem as ApiEnumMember;private _createDescriptionCell(apiItem: ApiItem): DocTableCell {
const configuration: TSDocConfiguration = this._tsdocConfiguration;
const section: DocSection = new DocSection({ configuration });
if (ApiReleaseTagMixin.isBaseClassOf(apiItem)) {
if (apiItem.releaseTag === ReleaseTag.Beta) {
section.appendNodesInParagraph([
new DocEmphasisSpan({ configuration, bold: true, italic: true }, [
new DocPlainText({ configuration, text: '(BETA)' })
]),
new DocPlainText({ configuration, text: ' ' })
]);
}
}
if (apiItem instanceof ApiDocumentedItem) {
if (apiItem.tsdocComment !== undefined) {
this._appendAndMergeSection(section, apiItem.tsdocComment.summarySection);
}
}
return new DocTableCell({ configuration }, section.nodes);case ApiItemKind.Property:
case ApiItemKind.PropertySignature:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} property` }));
break;
case ApiItemKind.TypeAlias:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} type` }));
break;
case ApiItemKind.Variable:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} variable` }));
break;
default:
throw new Error('Unsupported API item kind: ' + apiItem.kind);
}
if (ApiReleaseTagMixin.isBaseClassOf(apiItem)) {
if (apiItem.releaseTag === ReleaseTag.Beta) {
this._writeBetaWarning(output);
}
}
if (apiItem instanceof ApiDocumentedItem) {
const tsdocComment: DocComment | undefined = apiItem.tsdocComment;
if (tsdocComment) {
if (tsdocComment.deprecatedBlock) {
output.appendNode(
new DocNoteBox({ configuration: this._tsdocConfiguration }, [
new DocParagraph({ configuration: this._tsdocConfiguration }, [
new DocPlainText({
configuration: this._tsdocConfiguration,
text: 'Warning: This API is now obsolete. ',
}),