Commit bf29b068 authored by gumen's avatar gumen 🐢

Fix @memberof description

parent c323d83b
......@@ -209,3 +209,9 @@ dopiero na większym projekcie pełnym JSDocków.
Teraz obsługa opcji a na deser zamienię to wszystko w plugin. Taką
mam nadzieję.
nie, 19 sty 2020, 19:20:32 CET
Kończą mi się siły. Naprawiłem jeszcze drobne błędy i dodałem
brakującą dokumentację do jednej funkcji. Chyba na dzisiaj
wystarczy. Będzie łatwiej w pracy ogarnąć te opcje i plugin.
......@@ -55,6 +55,11 @@ function formatDescription(text) {
return text || ''
}
/**
* Control order of tags by weights. Smaller value brings tag higher.
* @param {String} tagTitle
* @return {Number} Tag weight
*/
function getTagOrderWeight(tagTitle) {
var tagsWeightMap = {
'private' : 1,
......@@ -125,7 +130,7 @@ module.exports = function jsdocParser(text, parsers, options) {
}
}
if (tag.title !== 'example') tag.description = formatDescription(tag.description)
if (!['example', 'memberof'].includes(tag.title)) tag.description = formatDescription(tag.description)
if (!tag.description && !['example', 'private'].includes(tag.title)) tag.description = 'TODO.'
return tag
......
......@@ -47,6 +47,7 @@ test('Should format regular jsDoc', () => {
* @param {String} [defaultValue="defaultTest"] TODO
* @arg {Number|Null} [optionalNumber]
* @private
*@memberof test
* @examples
* var one = 5
* var two = 10
......@@ -58,6 +59,7 @@ const testFunction = (text, defaultValue, optionalNumber) => true
const expected = `/**
* @private
* @memberof test
* @description Function example description that was wrapped by hand so it have
* more then one line and don't end with a dot REPEATED TWO TIMES
* BECAUSE IT WAS EASIER to copy function example description that
......@@ -81,7 +83,7 @@ const testFunction = (text, defaultValue, optionalNumber) => true
const testFunction = (text, defaultValue, optionalNumber) => true;
`
expect(result).toEqual(expected)
expect(result).toEqual(expected)
})
test('Should add empty line after @description and @example description if necessary', () => {
......
* Golden Hour
:LOGBOOK:
CLOCK: [2020-01-19 nie 18:38]--[2020-01-19 nie 19:20] => 0:42
CLOCK: [2020-01-19 nie 15:55]--[2020-01-19 nie 16:38] => 0:43
CLOCK: [2020-01-19 nie 14:51]--[2020-01-19 nie 15:36] => 0:45
CLOCK: [2020-01-19 nie 09:35]--[2020-01-19 nie 10:21] => 0:46
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment