Socket
Socket
Sign inDemoInstall

doxme

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doxme - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

test/function.js

4

index.js

@@ -61,3 +61,3 @@ var util = require('./util.js'),

var name = '', mod;
if (alias = getTag(d.tags, 'alias')) {
if (alias = getTag(d.tags, ['alias', 'function', 'func', 'method'])) {
name = alias.string;

@@ -108,3 +108,3 @@ } else if (mod = getTag(d.tags, 'module')) {

if (returns = getTag(d.tags, 'returns') || getTag(d.tags, 'return')) {
if (returns = getTag(d.tags, ['returns', 'return'])) {
log('\n**Returns** `%s`, %s\n', returns.types.join(','), reformat(returns.description));

@@ -111,0 +111,0 @@ }

{
"name": "doxme",
"version": "1.6.0",
"version": "1.7.0",
"description": "create markdown docs for dox output",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -38,3 +38,9 @@ var test = require('tape'),

});
t.test('@function tag', function(t) {
var result = doxme(dox.parseComments(fs.readFileSync('./test/function.js', 'utf8')));
if (process.env.UPDATE) { fs.writeFileSync('test/function.md', result); }
t.equal(result, fs.readFileSync('test/function.md', 'utf8'));
t.end();
});
t.end();
});
var striptags = require('striptags');
function find (array, func) {
if (!Array.isArray(array)) return undefined;
var index = 0, length = array.length;
while (index < length) {
if (func(array[index], index, array)) return array[index];
index++;
}
}
module.exports.getTags = function(tags, type) {

@@ -7,4 +17,8 @@ return tags.filter(function(t) { return t.type === type; });

module.exports.getTag = function(tags, type) {
return tags.filter(function(t) { return t.type === type; })[0];
module.exports.getTag = function getTag (tags, type) {
if (Array.isArray(type)) return getTag(
tags,
find(type, function (singleType) { return getTag(tags, singleType); })
);
return find(tags, function(t) { return t.type === type; });
};

@@ -11,0 +25,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