Skip to content

Commit ab84cd0

Browse files
committed
Improve readability of types and names
1 parent e81cfa1 commit ab84cd0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4854,7 +4854,7 @@ namespace ts {
48544854
if (node.type && node.type.kind === SyntaxKind.JSDocOptionalType) {
48554855
return true;
48564856
}
4857-
const paramTags = getJSDocParameterTag(node);
4857+
const paramTags = getJSDocParameterTags(node);
48584858
if (paramTags) {
48594859
for (const paramTag of paramTags) {
48604860
if (paramTag.isBracketed) {

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ namespace ts {
498498
/* @internal */ original?: Node; // The original node if this is an updated node.
499499
/* @internal */ startsOnNewLine?: boolean; // Whether a synthesized node should start on a new line (used by transforms).
500500
/* @internal */ jsDocComments?: JSDoc[]; // JSDoc for the node, if it has any.
501-
/* @internal */ jsDocCache?: (JSDoc | JSDocParameterTag)[]; // JSDoc for the node, plus JSDoc retrieved from its parents
501+
/* @internal */ jsDocCache?: (JSDoc | JSDocTag)[]; // JSDoc for the node, plus JSDoc and tags retrieved from its parents
502502
/* @internal */ symbol?: Symbol; // Symbol declared by node (initialized by binding)
503503
/* @internal */ locals?: SymbolTable; // Locals associated with node (initialized by binding)
504504
/* @internal */ nextContainer?: Node; // Next container in declaration order (initialized by binding)

src/compiler/utilities.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ namespace ts {
14271427
for (const doc of docs) {
14281428
if (doc.kind === SyntaxKind.JSDocParameterTag) {
14291429
if (doc.kind === kind) {
1430-
result.push(doc as JSDocParameterTag);
1430+
result.push(doc as JSDocTag);
14311431
}
14321432
}
14331433
else {
@@ -1442,8 +1442,8 @@ namespace ts {
14421442
return node && firstOrUndefined(getJSDocTags(node, kind));
14431443
}
14441444

1445-
function getJSDocs(node: Node): (JSDoc | JSDocParameterTag)[] {
1446-
let cache: (JSDoc | JSDocParameterTag)[] = node.jsDocCache;
1445+
function getJSDocs(node: Node): (JSDoc | JSDocTag)[] {
1446+
let cache: (JSDoc | JSDocTag)[] = node.jsDocCache;
14471447
if (!cache) {
14481448
getJSDocsWorker(node);
14491449
node.jsDocCache = cache;
@@ -1491,7 +1491,7 @@ namespace ts {
14911491

14921492
// Pull parameter comments from declaring function as well
14931493
if (node.kind === SyntaxKind.Parameter) {
1494-
cache = concatenate(cache, getJSDocParameterTag(node));
1494+
cache = concatenate(cache, getJSDocParameterTags(node));
14951495
}
14961496

14971497
if (isVariableLike(node) && node.initializer) {
@@ -1502,7 +1502,7 @@ namespace ts {
15021502
}
15031503
}
15041504

1505-
export function getJSDocParameterTag(param: Node): JSDocParameterTag[] {
1505+
export function getJSDocParameterTags(param: Node): JSDocParameterTag[] {
15061506
if (!isParameter(param)) {
15071507
return undefined;
15081508
}
@@ -1530,7 +1530,7 @@ namespace ts {
15301530
export function getJSDocType(node: Node): JSDocType {
15311531
let tag: JSDocTypeTag | JSDocParameterTag = getFirstJSDocTag(node, SyntaxKind.JSDocTypeTag) as JSDocTypeTag;
15321532
if (!tag && node.kind === SyntaxKind.Parameter) {
1533-
const paramTags = getJSDocParameterTag(node);
1533+
const paramTags = getJSDocParameterTags(node);
15341534
if (paramTags) {
15351535
tag = find(paramTags, tag => !!tag.typeExpression);
15361536
}
@@ -1558,7 +1558,7 @@ namespace ts {
15581558
export function isRestParameter(node: ParameterDeclaration) {
15591559
if (node && (node.flags & NodeFlags.JavaScriptFile)) {
15601560
if (node.type && node.type.kind === SyntaxKind.JSDocVariadicType ||
1561-
forEach(getJSDocParameterTag(node),
1561+
forEach(getJSDocParameterTags(node),
15621562
t => t.typeExpression && t.typeExpression.type.kind === SyntaxKind.JSDocVariadicType)) {
15631563
return true;
15641564
}

0 commit comments

Comments
 (0)