From dd44ecf18516425516dbd58756a2c55a0f06c521 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Sat, 28 Mar 2020 10:51:25 +0100 Subject: [PATCH] Only document enums when they have API properties --- config/jsdoc/api/plugins/api.js | 12 +++++------- config/jsdoc/api/template/tmpl/method.tmpl | 11 ++++------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/config/jsdoc/api/plugins/api.js b/config/jsdoc/api/plugins/api.js index c384d86dad..53e0a8c174 100644 --- a/config/jsdoc/api/plugins/api.js +++ b/config/jsdoc/api/plugins/api.js @@ -73,9 +73,6 @@ function includeAugments(doclet) { }); } cls._hideConstructor = true; - if (!cls.undocumented) { - cls._documented = true; - } } } } @@ -182,13 +179,14 @@ exports.handlers = { doclet._hideConstructor = true; includeAugments(doclet); sortOtherMembers(doclet); - } else if (!doclet._hideConstructor - && !(doclet.longname in defaultExports && byLongname[doclet.longname].some(d => d.isEnum))) { + } else if (!doclet._hideConstructor) { // Remove all other undocumented symbols doclet.undocumented = true; } - if (doclet._documented) { - delete doclet.undocumented; + if (doclet.memberof && byLongname[doclet.memberof] && + byLongname[doclet.memberof][0].isEnum && + !byLongname[doclet.memberof][0].properties.some(p => p.stability)) { + byLongname[doclet.memberof][0].undocumented = true; } } }, diff --git a/config/jsdoc/api/template/tmpl/method.tmpl b/config/jsdoc/api/template/tmpl/method.tmpl index a5ddc77f5d..9ff68aa638 100644 --- a/config/jsdoc/api/template/tmpl/method.tmpl +++ b/config/jsdoc/api/template/tmpl/method.tmpl @@ -64,7 +64,7 @@ var self = this;