comment-parser
Advanced tools
Comparing version 0.7.2 to 0.7.3
@@ -0,1 +1,4 @@ | ||
# v0.7.3 | ||
- make stringify result more close to the source | ||
# v0.7.2 | ||
@@ -2,0 +5,0 @@ - make stringify to start each line with * in multiline comments |
{ | ||
"name": "comment-parser", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "Generic JSDoc-like comment parser. ", | ||
@@ -13,12 +13,13 @@ "main": "index.js", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.6.0", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-node": "^10.0.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-standard": "^14.1.1", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"mocha": "^6.2.2", | ||
"nodemon": "^1.19.4", | ||
"nyc": "^14.1.1", | ||
"typescript": "^3.6.4" | ||
"mocha": "^7.1.2", | ||
"nodemon": "^2.0.3", | ||
"nyc": "^15.0.1", | ||
"readable-stream": "^3.6.0", | ||
"typescript": "^3.8.3" | ||
}, | ||
@@ -25,0 +26,0 @@ "engines": { |
@@ -36,4 +36,2 @@ | ||
function parse_tag (str, parsers) { | ||
if (typeof str !== 'string' || !(/\s*@/).test(str)) { return null } | ||
const data = parsers.reduce(function (state, parser) { | ||
@@ -143,3 +141,2 @@ let result | ||
const tag_node = parse_tag(tag.source, opts.parsers) | ||
if (!tag_node) { return tags } | ||
@@ -146,0 +143,0 @@ tag_node.line = tag.line |
@@ -73,3 +73,3 @@ 'use strict' | ||
res = { name: name, optional: false } | ||
res = { name, optional: false } | ||
@@ -76,0 +76,0 @@ if (name[0] === '[' && name[name.length - 1] === ']') { |
@@ -36,6 +36,12 @@ 'use strict' | ||
const indnt = getIndent(indent) | ||
return (block.description ? `${indnt}${block.description.replace(/^/gm, '* ')}\n${indnt}*\n` : '') + | ||
block.tags.reduce((s, tag) => { | ||
return s + stringifyTag(tag, { indent }) | ||
}, '') | ||
return ( | ||
block.description | ||
? block.description.replace(/^\n/, '').replace(/^(.*)\n?/gm, (n0, descLine) => { | ||
return `${indnt}*${descLine ? ` ${descLine}` : ''}\n` | ||
}) | ||
: '' | ||
) + block.tags.reduce((s, tag) => { | ||
return s + stringifyTag(tag, { indent }) | ||
}, '') | ||
} | ||
@@ -50,7 +56,8 @@ | ||
} = tag | ||
return indnt + `* @${tagName}` + | ||
(type ? ` {${type}}` : '') + | ||
(name ? ` ${ | ||
(name.trim() ? ` ${ | ||
optional ? '[' : '' | ||
}${name}${deflt ? `=${deflt}` : ''}${ | ||
}${name.trimEnd()}${deflt ? `=${deflt}` : ''}${ | ||
optional ? ']' : '' | ||
@@ -57,0 +64,0 @@ }` : '') + |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
33871
12
13
635