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

esprima-extract-comments

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esprima-extract-comments - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

17

index.js

@@ -33,3 +33,18 @@ /*!

const tokens = esprima.tokenize(str, Object.assign({}, defaults, options));
return tokens.filter(isComment);
const comments = [];
for (let i = 0; i < tokens.length; i++) {
let n = i + 1;
const token = tokens[i];
let next = tokens[n];
if (isComment(token)) {
if (token.type === 'BlockComment') {
while (next && /comment/i.test(next.type)) next = tokens[++n];
token.codeStart = next && !/(comment|punc)/i.test(next.type) ? next.range[0] : null;
}
comments.push(token);
}
}
return comments;
}

@@ -36,0 +51,0 @@

2

package.json
{
"name": "esprima-extract-comments",
"description": "Extract code comments from string or from a glob of files using esprima.",
"version": "1.0.1",
"version": "1.1.0",
"homepage": "https://github.com/jonschlinkert/esprima-extract-comments",

@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

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