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

atomdoc

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atomdoc - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

36

lib/parser.js

@@ -21,3 +21,3 @@ (function() {

ArgumentListItemRegex = '^\\s*`([\\w\\.-]+)`(\\s*[:-])?\\s*';
ArgumentListItemRegex = '^\\s*`([\\w\\.-]+)`(\\s*[:-])?(\\s*\\(optional\\))?\\s*';

@@ -57,4 +57,7 @@ /*

parseSummaryAndDescription = function(tokens) {
parseSummaryAndDescription = function(tokens, tokenCallback) {
var description, rawSummary, rawVisibility, returnValues, summary, visibility, visibilityMatch;
if (tokenCallback == null) {
tokenCallback = stopOnSectionBoundaries;
}
summary = '';

@@ -82,3 +85,3 @@ description = '';

summary = rawSummary;
description = generateDescription(tokens, stopOnSectionBoundaries);
description = generateDescription(tokens, tokenCallback);
if (rawVisibility != null) {

@@ -117,3 +120,3 @@ description = description.replace(rawVisibility, '');

parseEventsSection = function(tokens) {
var args, description, events, firstToken, name, summary, _ref1;
var args, description, events, firstToken, name, stopTokenCallback, summary, visibility, _ref1;
firstToken = _.first(tokens);

@@ -123,17 +126,21 @@ if (!(firstToken && firstToken.type === 'heading' && firstToken.text === 'Events' && firstToken.depth === SpecialHeadingDepth)) {

}
stopTokenCallback = function(token, tokens) {
if (token.type === 'heading' && token.depth === SpecialHeadingDepth + 1) {
return false;
}
return stopOnSectionBoundaries(token, tokens);
};
events = [];
tokens.shift();
while (tokens.length) {
generateDescription(tokens, function(token, tokens) {
if (token.type === 'heading' && token.depth === SpecialHeadingDepth + 1) {
return false;
}
return stopOnSectionBoundaries(token, tokens);
});
generateDescription(tokens, stopTokenCallback);
firstToken = _.first(tokens);
if ((firstToken != null ? firstToken.type : void 0) === 'heading') {
tokens.shift();
_ref1 = parseSummaryAndDescription(tokens), summary = _ref1.summary, description = _ref1.description;
_ref1 = parseSummaryAndDescription(tokens, stopTokenCallback), summary = _ref1.summary, description = _ref1.description, visibility = _ref1.visibility;
name = firstToken.text;
args = parseArgumentList(tokens);
if (args.length === 0) {
args = null;
}
events.push({

@@ -143,2 +150,3 @@ name: name,

description: description,
visibility: visibility,
"arguments": args

@@ -286,3 +294,3 @@ });

parseListItem = function(argumentString) {
var description, name, nameMatches, type;
var description, isOptional, name, nameMatches, type;
name = null;

@@ -295,2 +303,3 @@ type = null;

type = getLinkMatch(description);
isOptional = !!nameMatches[3];
}

@@ -300,3 +309,4 @@ return {

description: description,
type: type
type: type,
isOptional: isOptional
};

@@ -303,0 +313,0 @@ };

{
"name": "atomdoc",
"version": "0.2.1",
"version": "0.3.0",
"description": "A atomdoc parser",

@@ -5,0 +5,0 @@ "main": "./lib/atomdoc.js",

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