@wordpress/docgen 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -405,6 +405,10 @@ function unwrapWrappedSelectors( token ) {
405
405
  return token;
406
406
  }
407
407
 
408
+ if ( babelTypes.isFunctionExpression( token ) ) {
409
+ return token;
410
+ }
411
+
408
412
  if ( babelTypes.isArrowFunctionExpression( token ) ) {
409
413
  return token;
410
414
  }
@@ -433,7 +437,7 @@ function unwrapWrappedSelectors( token ) {
433
437
 
434
438
  /**
435
439
  * @param {ASTNode} token
436
- * @return {babelTypes.ArrowFunctionExpression | babelTypes.FunctionDeclaration} The function token.
440
+ * @return {babelTypes.ArrowFunctionExpression | babelTypes.FunctionDeclaration | babelTypes.FunctionExpression} The function token.
437
441
  */
438
442
  function getFunctionToken( token ) {
439
443
  let resolvedToken = token;
@@ -517,8 +521,7 @@ function getQualifiedObjectPatternTypeAnnotation( tag, paramType ) {
517
521
  function getParamTypeAnnotation( tag, declarationToken, paramIndex ) {
518
522
  const functionToken = getFunctionToken( declarationToken );
519
523
 
520
- // Otherwise find the corresponding parameter token for the documented parameter.
521
- let paramToken = functionToken.params[ paramIndex ];
524
+ let paramToken = functionToken?.params[ paramIndex ];
522
525
 
523
526
  // This shouldn't happen due to our ESLint enforcing correctly documented parameter names but just in case
524
527
  // we'll give a descriptive error so that it's easy to diagnose the issue.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/docgen",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Autogenerate public API documentation from exports and JSDoc comments.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
45
+ "gitHead": "122867d355ca4edc63d3a3bbd9411d3a2e1458df"
46
46
  }