mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
simplify logic
This commit is contained in:
parent
97dc742654
commit
7dfefd7910
@ -28,14 +28,10 @@ exports.validate = function(tag, tagDef, meta) {
|
|||||||
if (!tagDef && !env.conf.tags.allowUnknownTags) {
|
if (!tagDef && !env.conf.tags.allowUnknownTags) {
|
||||||
logger.error( buildMessage(tag.title, meta, 'is not a known tag') );
|
logger.error( buildMessage(tag.title, meta, 'is not a known tag') );
|
||||||
}
|
}
|
||||||
else if (!tag.text) {
|
else if (!tag.text && tagDef.mustHaveValue) {
|
||||||
if (tagDef.mustHaveValue) {
|
|
||||||
logger.error( buildMessage(tag.title, meta, 'requires a value') );
|
logger.error( buildMessage(tag.title, meta, 'requires a value') );
|
||||||
}
|
}
|
||||||
}
|
else if (tag.text && tagDef.mustNotHaveValue) {
|
||||||
else {
|
|
||||||
if (tagDef.mustNotHaveValue) {
|
|
||||||
logger.error( buildMessage(tag.title, meta, 'does not permit a value') );
|
logger.error( buildMessage(tag.title, meta, 'does not permit a value') );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user