Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable */
var fs = require('fs'),
path = require('path'),
File = require('vinyl'),
vfs = require('vinyl-fs'),
_ = require('lodash'),
concat = require('concat-stream'),
GithubSlugger = require('github-slugger'),
createFormatters = require('documentation').util.createFormatters,
LinkerStack = require('documentation').util.LinkerStack,
hljs = require('highlight.js');
function isFunction(section) {
return (
section.kind === 'function' ||
(section.kind === 'typedef' &&
section.type.type === 'NameExpression' &&
section.type.name === 'Function')
);
}
module.exports = function(
comments,
config
) {
var linkerStack = new LinkerStack(config).namespaceResolver(
/* eslint-disable import/no-extraneous-dependencies, prefer-destructuring,
no-mixed-operators, guard-for-in, no-buffer-constructor, no-restricted-syntax */
const fs = require('fs');
const path = require('path');
const write = require('vinyl-write');
const Vinyl = require('vinyl');
const _ = require('lodash');
const GithubSlugger = require('github-slugger');
const createFormatters = require('documentation').util.createFormatters;
const LinkerStack = require('documentation').util.LinkerStack;
const hljs = require('highlight.js');
function isFunction(section) {
return section.kind === 'function' || section.kind === 'typedef' &&
section.type.type === 'NameExpression' && section.type.name === 'Function';
}
module.exports = function (comments, config) {
const linkerStack = new LinkerStack(config).namespaceResolver(comments, (namespace) => {
const slugger = new GithubSlugger();
return `#${slugger.slug(namespace)}`;
});
const formatters = createFormatters(linkerStack.link);
// Add an Index
'Array',
'function',
'boolean',
'string',
'object',
'number',
'any'
])
const KINDS = [
['Functions', i => i.kind === 'function'],
['Callbacks', i => i.kind === 'typedef' && isCallback(i)],
['Types', i => i.kind === 'typedef' && !isCallback(i)],
['Constants', i => i.kind === 'constant']
]
let formatters = documentation.util.createFormatters()
function toSlug (type) {
let slug = type
if (!CAPITALIZED.test(slug)) slug = 'globals-' + slug
return slugify(slug).toLowerCase()
}
function toSourceUrl ({ file, loc }) {
return file.replace(
/^.*\/logux-([^/]+)\/(.*)$/,
'https://github.com/logux/$1/blob/master/$2'
) + `#L${ loc.start.line }L${ loc.end.line }`
}
function byName (a, b) {
if (CAPITALIZED.test(a.name) && !CAPITALIZED.test(b.name)) {
const fs = require('fs')
const path = require('path')
const File = require('vinyl')
const vfs = require('vinyl-fs')
const _ = require('lodash')
const concat = require('concat-stream')
const GithubSlugger = require('github-slugger')
const createFormatters = require('documentation').util.createFormatters
const LinkerStack = require('documentation').util.LinkerStack
const hljs = require('highlight.js')
function isFunction(section) {
return (
section.kind === 'function' ||
(section.kind === 'typedef' &&
section.type.type === 'NameExpression' &&
section.type.name === 'Function')
)
}
module.exports = function (comments, config, callback) {
const linkerStack = new LinkerStack(config).namespaceResolver(
comments,
function (namespace) {
const slugger = new GithubSlugger()
const fs = require('fs')
const path = require('path')
const File = require('vinyl')
const vfs = require('vinyl-fs')
const _ = require('lodash')
const concat = require('concat-stream')
const GithubSlugger = require('github-slugger')
const createFormatters = require('documentation').util.createFormatters
const LinkerStack = require('documentation').util.LinkerStack
const hljs = require('highlight.js')
function isFunction(section) {
return (
section.kind === 'function' ||
(section.kind === 'typedef' &&
section.type.type === 'NameExpression' &&
section.type.name === 'Function')
)
}
module.exports = function (comments, config, callback) {
const linkerStack = new LinkerStack(config).namespaceResolver(
comments,
function (namespace) {
'use strict';
var fs = require('fs'),
path = require('path'),
File = require('vinyl'),
vfs = require('vinyl-fs'),
_ = require('lodash'),
concat = require('concat-stream'),
GithubSlugger = require('github-slugger'),
createFormatters = require('documentation').util.createFormatters,
LinkerStack = require('documentation').util.LinkerStack,
hljs = require('highlight.js');
function isFunction(section) {
return section.kind === 'function' || section.kind === 'typedef' && section.type.type === 'NameExpression' && section.type.name === 'Function';
}
module.exports = function (comments, config) {
var linkerStack = new LinkerStack(config).namespaceResolver(comments, function (namespace) {
var slugger = new GithubSlugger();
return '#' + slugger.slug(namespace);
});
var formatters = createFormatters(linkerStack.link);
hljs.configure(config.hljs || {});
'use strict';
var fs = require('fs'),
path = require('path'),
File = require('vinyl'),
vfs = require('vinyl-fs'),
_ = require('lodash'),
concat = require('concat-stream'),
GithubSlugger = require('github-slugger'),
createFormatters = require('documentation').util.createFormatters,
LinkerStack = require('documentation').util.LinkerStack,
hljs = require('highlight.js');
function isFunction(section) {
return section.kind === 'function' || section.kind === 'typedef' && section.type.type === 'NameExpression' && section.type.name === 'Function';
}
module.exports = function (comments, config) {
var linkerStack = new LinkerStack(config).namespaceResolver(comments, function (namespace) {
var slugger = new GithubSlugger();
return '#' + slugger.slug(namespace, true);
});
var formatters = createFormatters(linkerStack.link);
hljs.configure(config.hljs || {});
var sharedImports = {
'use strict';
var fs = require('fs'),
path = require('path'),
File = require('vinyl'),
vfs = require('vinyl-fs'),
_ = require('lodash'),
concat = require('concat-stream'),
GithubSlugger = require('github-slugger'),
createFormatters = require('documentation').util.createFormatters,
LinkerStack = require('documentation').util.LinkerStack,
hljs = require('highlight.js');
function isFunction(section) {
return section.kind === 'function' || section.kind === 'typedef' && section.type.type === 'NameExpression' && section.type.name === 'Function';
}
module.exports = function (comments, config) {
var linkerStack = new LinkerStack(config).namespaceResolver(comments, function (namespace) {
var slugger = new GithubSlugger();
return '#' + slugger.slug(namespace);
});
var formatters = createFormatters(linkerStack.link);
hljs.configure(config.hljs || {});
'use strict';
var fs = require('fs'),
path = require('path'),
File = require('vinyl'),
vfs = require('vinyl-fs'),
_ = require('lodash'),
concat = require('concat-stream'),
GithubSlugger = require('github-slugger'),
createFormatters = require('documentation').util.createFormatters,
LinkerStack = require('documentation').util.LinkerStack,
hljs = require('highlight.js');
function isFunction(section) {
return section.kind === 'function' || section.kind === 'typedef' && section.type.type === 'NameExpression' && section.type.name === 'Function';
}
module.exports = function (comments, config) {
var linkerStack = new LinkerStack(config).namespaceResolver(comments, function (namespace) {
var slugger = new GithubSlugger();
return '#' + slugger.slug(namespace, true);
});
var formatters = createFormatters(linkerStack.link);
hljs.configure(config.hljs || {});
'use strict'
const GithubSlugger = require('github-slugger')
const hljs = require('highlight.js')
const util = require('documentation').util
const createFormatters = util.createFormatters
const LinkerStack = util.LinkerStack
const _ = require('lodash')
module.exports = class Utils {
constructor (options, comments) {
this.linkerStack = new LinkerStack(options)
.namespaceResolver(comments, (namespace) => {
const slugger = new GithubSlugger()
return '#' + slugger.slug(namespace)
})
this.options = options
this.comments = comments
this.formatters = createFormatters(this.linkerStack.link)
this.options.hljs = this.options.hljs || {}