Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

comment-parser

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comment-parser - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

.editorconfig

3

CHANGELOG.md

@@ -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

19

package.json
{
"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 @@ }` : '') +

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc