@wordpress/docgen 1.64.0 → 1.66.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.
|
@@ -20,7 +20,9 @@ const hasVariableWithName = ( node, name ) =>
|
|
|
20
20
|
node.declarations.some( ( declaration ) => {
|
|
21
21
|
if ( declaration.id.type === 'ObjectPattern' ) {
|
|
22
22
|
return declaration.id.properties.some(
|
|
23
|
-
( property ) =>
|
|
23
|
+
( property ) =>
|
|
24
|
+
property.key?.name === name ||
|
|
25
|
+
property.argument?.name === name
|
|
24
26
|
);
|
|
25
27
|
}
|
|
26
28
|
return declaration.id.name === name;
|
|
@@ -237,16 +237,20 @@ function getMappedTypeAnnotation( typeAnnotation ) {
|
|
|
237
237
|
* @param {babelTypes.TSTypeReference} typeAnnotation
|
|
238
238
|
*/
|
|
239
239
|
function getTypeReferenceTypeAnnotation( typeAnnotation ) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
let typeName;
|
|
241
|
+
if ( babelTypes.isTSQualifiedName( typeAnnotation.typeName ) ) {
|
|
242
|
+
typeName = unifyQualifiedName( typeAnnotation.typeName );
|
|
243
|
+
} else {
|
|
244
|
+
typeName = typeAnnotation.typeName.name;
|
|
245
245
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
|
|
247
|
+
if ( typeAnnotation.typeParameters ) {
|
|
248
|
+
const typeParams = typeAnnotation.typeParameters.params
|
|
249
|
+
.map( getTypeAnnotation )
|
|
250
|
+
.join( ', ' );
|
|
251
|
+
typeName = `${ typeName }< ${ typeParams } >`;
|
|
252
|
+
}
|
|
253
|
+
return typeName;
|
|
250
254
|
}
|
|
251
255
|
|
|
252
256
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/docgen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.66.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": "
|
|
41
|
+
"gitHead": "581d8a5580dba8f600b7268d51eb554771ae482c"
|
|
42
42
|
}
|