@wordpress/docgen 1.40.0 → 1.41.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.
@@ -28,9 +28,19 @@ module.exports = ( token ) => {
28
28
  let paramCount = 0;
29
29
 
30
30
  jsdoc.tags = jsdoc.tags.map( ( tag ) => {
31
+ const isParam = tag.tag === 'param';
31
32
  const isUnqualifiedParam =
32
- tag.tag === 'param' && ! tag.name.includes( '.' );
33
- const index = isUnqualifiedParam ? paramCount++ : paramCount;
33
+ isParam && ! tag.name.includes( '.' );
34
+ let index = isUnqualifiedParam ? paramCount++ : paramCount;
35
+
36
+ // Qualified parameters come after an unqualified parameter. When
37
+ // the paramCount is incremented for an unqualified parameter, we
38
+ // still need to access that previous index. In other words, the
39
+ // qualified parameter types exist at the index of the previous
40
+ // unqualified parameter. As a result, the index is actually less.
41
+ if ( isParam && index > 0 && ! isUnqualifiedParam ) {
42
+ index -= 1;
43
+ }
34
44
 
35
45
  return {
36
46
  ...tag,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/docgen",
3
- "version": "1.40.0",
3
+ "version": "1.41.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",
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "d61700b9f1c72ba0b030fc815ef1685b4f4031ec"
41
+ "gitHead": "6df0c62d43b8901414ccd22ffbe56eaa99d012a6"
42
42
  }