jsdoc-memberof-namespace
Advanced tools
Comparing version 2.1.0 to 2.2.0
13
index.js
@@ -6,3 +6,3 @@ const logger = require('jsdoc/util/logger'); | ||
const kinds = ['class', 'constant', 'function']; | ||
const kinds = ['class', 'constant', 'function', 'namespace']; | ||
const namespaces = []; | ||
@@ -25,3 +25,3 @@ | ||
if (doc.kind === 'namespace') { | ||
if (doc.kind === 'namespace' && isEmpty(doc.meta.code)) { | ||
if (namespaces.every(ns => ns.longname !== doc.longname)) { | ||
@@ -62,2 +62,11 @@ logger.debug(`[JMN] Found ${dsc}`); | ||
/** | ||
* Check if value is falsy or empty | ||
* @param {Object} value - Object | ||
* @return {boolean} - True if falsy or empty, false otherwise | ||
*/ | ||
function isEmpty(value) { | ||
return !value || Object.keys(value).length === 0; | ||
} | ||
/** | ||
* Check if file path is an index.js file | ||
@@ -64,0 +73,0 @@ * @param {string} file - File path |
{ | ||
"name": "jsdoc-memberof-namespace", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "JSDoc plugin to automatically generate memberof namespace tags", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8278
91