@microsoft/api-extractor
Advanced tools
Comparing version 7.39.5 to 7.40.0
@@ -13,2 +13,3 @@ import { ApiModel, ApiPackage } from '@microsoft/api-extractor-model'; | ||
private _processDeclaration; | ||
private _tryFindFunctionDeclaration; | ||
private _processChildDeclarations; | ||
@@ -15,0 +16,0 @@ private _processApiCallSignature; |
@@ -190,3 +190,10 @@ "use strict"; | ||
case ts.SyntaxKind.VariableDeclaration: | ||
this._processApiVariable(astDeclaration, context); | ||
// check for arrow functions in variable declaration | ||
const functionDeclaration = this._tryFindFunctionDeclaration(astDeclaration); | ||
if (functionDeclaration) { | ||
this._processApiFunction(astDeclaration, context, functionDeclaration); | ||
} | ||
else { | ||
this._processApiVariable(astDeclaration, context); | ||
} | ||
break; | ||
@@ -197,2 +204,6 @@ default: | ||
} | ||
_tryFindFunctionDeclaration(astDeclaration) { | ||
const children = astDeclaration.declaration.getChildren(astDeclaration.declaration.getSourceFile()); | ||
return children.find(ts.isFunctionTypeNode); | ||
} | ||
_processChildDeclarations(astDeclaration, context) { | ||
@@ -389,3 +400,3 @@ for (const childDeclaration of astDeclaration.children) { | ||
} | ||
_processApiFunction(astDeclaration, context) { | ||
_processApiFunction(astDeclaration, context, altFunctionDeclaration) { | ||
const { name, isExported, parentApiItem } = context; | ||
@@ -396,3 +407,3 @@ const overloadIndex = this._collector.getOverloadIndex(astDeclaration); | ||
if (apiFunction === undefined) { | ||
const functionDeclaration = astDeclaration.declaration; | ||
const functionDeclaration = altFunctionDeclaration !== null && altFunctionDeclaration !== void 0 ? altFunctionDeclaration : astDeclaration.declaration; | ||
const nodesToCapture = []; | ||
@@ -399,0 +410,0 @@ const returnTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange(); |
{ | ||
"name": "@microsoft/api-extractor", | ||
"version": "7.39.5", | ||
"version": "7.40.0", | ||
"description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups", | ||
@@ -45,4 +45,4 @@ "keywords": [ | ||
"@rushstack/node-core-library": "3.65.0", | ||
"@rushstack/rig-package": "0.5.1", | ||
"@rushstack/ts-command-line": "4.17.1" | ||
"@rushstack/ts-command-line": "4.17.1", | ||
"@rushstack/rig-package": "0.5.1" | ||
}, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1581197
15556