@es-joy/jsdoccomment
Advanced tools
Comparing version 0.23.3 to 0.23.4
# CHANGES for `@es-joy/jsdoccomment` | ||
## 0.23.4 | ||
- fix(`estreeToString`): add `delimiter`, etc. if adding `JsdocDescriptionLine` | ||
for `JsdocBlock` | ||
- fix(`estreeToString`): add line break when tags are present (unless already | ||
ending in newline) | ||
## 0.23.3 | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@es-joy/jsdoccomment", | ||
"version": "0.23.3", | ||
"version": "0.23.4", | ||
"author": "Brett Zamir <brettz9@yahoo.com>", | ||
@@ -5,0 +5,0 @@ "contributors": [], |
@@ -263,9 +263,17 @@ import {parse as jsdocTypePrattParse} from 'jsdoc-type-pratt-parser'; | ||
} | ||
: { | ||
delimiter: '', | ||
description, | ||
postDelimiter: '', | ||
initial: '', | ||
type: 'JsdocDescriptionLine' | ||
} | ||
: lastTag | ||
? { | ||
delimiter: '', | ||
description, | ||
postDelimiter: '', | ||
initial: '', | ||
type: 'JsdocDescriptionLine' | ||
} | ||
: { | ||
delimiter, | ||
description, | ||
postDelimiter, | ||
initial, | ||
type: 'JsdocDescriptionLine' | ||
} | ||
); | ||
@@ -272,0 +280,0 @@ holder.description += holder.description |
@@ -11,3 +11,6 @@ import { | ||
}, descriptionLines, tags) { | ||
const hasLineBeforeFinal = descriptionLines.length && tags.length; | ||
const alreadyHasLine = | ||
(descriptionLines.length && !tags.length && | ||
descriptionLines[descriptionLines.length - 1].endsWith('\n')) || | ||
(tags.length && tags[tags.length - 1].endsWith('\n')); | ||
return `${initial}${delimiter}${postDelimiter}${endLine | ||
@@ -26,3 +29,3 @@ ? ` | ||
tags.length ? tags.join(lineEnd + '\n') : '' | ||
}${endLine && (!hasLineBeforeFinal) | ||
}${endLine && !alreadyHasLine | ||
? ` | ||
@@ -29,0 +32,0 @@ ${initial}${lineEnd}` |
Sorry, the diff of this file is not supported yet
71152
1454