Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(sourceFiles).forEach(function(file) {
let source;
// links are keyed to the shortened path in each doclet's `meta.shortpath` property
let sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
try {
source = {
kind: 'source',
code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
};
}
catch(e) {
logger.error('Error while generating source file %s: %s', file, e.message);
}
generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
false);
});
}
Object.keys(sourceFiles).forEach(function(file) {
var source;
// links are keyed to the shortened path in each doclet's `meta.shortpath` property
var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
try {
source = {
kind: 'source',
code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
};
}
catch (e) {
logger.error('Error while generating source file %s: %s', file, e.message);
}
generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
false);
});
}
exports.handle = e => {
const logger = require('jsdoc/util/logger');
let msg = e ? ( e.message || JSON.stringify(e) ) : '';
// include the error type if it's an Error object
if (e instanceof Error) {
msg = `${e.name}: ${msg}`;
}
logger.error(msg);
};
Object.keys(sourceFiles).forEach(function(file) {
var source;
// links are keyed to the shortened path in each doclet's `meta.shortpath` property
var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
try {
source = {
kind: 'source',
code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
};
}
catch(e) {
logger.error('Error while generating source file %s: %s', file, e.message);
}
generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
false);
});
}
item.children.forEach(child => {
const childTutorial = exports.root.getByName(child);
if (!childTutorial) {
logger.error('Missing child tutorial: %s', child);
}
else {
childTutorial.setParent(current);
}
});
}
source = escapeUnderscores(source);
source = escapeUrls(source);
result = marked(source, { renderer: markedRenderer })
.replace(/\s+$/, '')
.replace(/'/g, "'");
result = unescapeUrls(result);
return result;
};
parserFunction._parser = parserNames.marked;
return parserFunction;
}
else {
logger.error('Unrecognized Markdown parser "%s". Markdown support is disabled.',
parserName);
}
}
function parseType({text, originalTitle}, {canHaveName, canHaveType}, meta) {
try {
return tag.type.parse(text, canHaveName, canHaveType);
}
catch (e) {
logger.error(
'Unable to parse a tag\'s type expression%s with tag title "%s" and text "%s": %s',
meta.filename ? ( ` for source file ${path.join(meta.path, meta.filename)}${meta.lineno ? (` in line ${meta.lineno}`) : ''}` ) : '',
originalTitle,
text,
e.message
);
return {};
}
}
generator(context, handleErrorCallback(function(err, data) {
if (err) {
logger.error('cannot generate ' + target);
logger.debug(err);
return;
}
write(target, data, cb);
}));
};
exports.resolveBorrows = function(doclets) {
var doclet;
if (!doclets.index) {
logger.error('Unable to resolve borrowed symbols, because the docs have not been indexed.');
return;
}
for (var i = 0, l = doclets.index.borrowed.length; i < l; i++) {
doclet = doclets.index.borrowed[i];
cloneBorrowedDoclets(doclet, doclets);
delete doclet.borrowed;
}
doclets.index.borrowed = [];
};
exports.defineTags = (dictionary, tagDefinitions) => {
let dictionaries;
if (!tagDefinitions) {
dictionaries = env.conf.tags.dictionaries;
if (!dictionaries) {
logger.error('The configuration setting "tags.dictionaries" is undefined. ' +
'Unable to load tag definitions.');
return;
}
else {
dictionaries = dictionaries.slice(0).reverse();
}
dictionaries.forEach(dictName => {
const tagDefs = exports[DEFINITIONS[dictName]];
if (!tagDefs) {
logger.error('The configuration setting "tags.dictionaries" contains ' +
'the unknown dictionary name %s. Ignoring the dictionary.', dictName);
return;