Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function TypeName (typeStr) {
var type;
var typeName = typeStr;
try {
if ('Function' == typeName) {
typeName = '{' + typeName + '}';
}
type = catharsis.parse(typeName);
if (type.type === catharsis.Types.TypeApplication && (type.expression.name === 'Array' || type.expression.name === 'Object')) {
typeName = type.applications[0].name;
} else if (type.type === catharsis.Types.FunctionType) {
typeName = 'Function';
type = null;
} else {
typeName = typeStr;
type = null;
}
} catch (e) {
// log.error('getTypeName: Parse of "%s" failed with reason: %s', typeStr, e.message);
typeName = typeStr;
}
var doc = aliasMap.getDocs(typeName);
var res = '';
if (doc.length === 1) {
doc = doc[0];
function TypeLink (typeStr) {
var type;
var typeName = typeStr;
try {
if ('Function' == typeName) {
typeName = '{' + typeName + '}';
}
type = catharsis.parse(typeName);
if (type.type === catharsis.Types.TypeApplication && (type.expression.name === 'Array' || type.expression.name === 'Object')) {
typeName = type.applications[0].name;
} else if (type.type === catharsis.Types.FunctionType) {
typeName = 'Function';
type = null;
} else {
typeName = typeStr;
type = null;
}
} catch (e) {
// log.error('getTypeName: Parse of "%s" failed with reason: %s', typeStr, e.message);
typeName = typeStr;
}
var doc = aliasMap.getDocs(typeName);
var res = '';
function getTypeStrings(parsedType, isOutermostType) {
var applications;
var typeString;
var types = [];
var TYPES = catharsis.Types;
switch(parsedType.type) {
case TYPES.AllLiteral:
types.push('*');
break;
case TYPES.FunctionType:
types.push('function');
break;
case TYPES.NameExpression:
types.push(parsedType.name);
break;
case TYPES.NullLiteral:
types.push('null');
break;
case TYPES.RecordType:
types.push('Object');
function getTypeStrings(parsedType) {
var types = [];
var catharsis = require('catharsis');
var TYPES = catharsis.Types;
var util = require('util');
switch(parsedType.type) {
case TYPES.AllLiteral:
types.push('*');
break;
case TYPES.FunctionType:
types.push('function');
break;
case TYPES.NameExpression:
types.push(parsedType.name);
break;
case TYPES.NullLiteral:
types.push('null');
break;
case TYPES.RecordType:
function TypeLink (typeStr) {
var typeName = typeStr;
try {
log.debug('[getTypeLink] building type link for %s', typeStr);
var type = catharsis.parse(typeName, {jsdoc: true});
if (type.type === catharsis.Types.TypeApplication) {
typeName = catharsis.stringify(type.applications[0], {restringify: true});
type = _.clone(type);
type.applications = type.applications.map(function (type) {
if (type.type !== catharsis.Types.FunctionType && type.type !== catharsis.Types.UndefinedLiteral) {
type.name = getLinkInfo(type.name).title;
}
return type;
});
} else {
if (type.type !== catharsis.Types.FunctionType && type.type !== catharsis.Types.UndefinedLiteral) {
typeName = type.name;
type = _.clone(type);
type.name = getLinkInfo(type.name).title;
}
}
typeStr = catharsis.stringify(type, {restringify: true});
} catch (e) {
log.error('[getTypeLink] Parse of "%s" failed with reason: %s', typeStr, e.message);
typeName = typeStr;
}
var res = _.template('{@link ${link} ${title}}')({link: typeName, title: typeStr});
log.silly('[getTypeLink] built link %s', res);
return res;
};
function getTypeStrings(parsedType) {
var types = [];
var TYPES = catharsis.Types;
var util = require('util');
switch(parsedType.type) {
case TYPES.AllLiteral:
types.push('*');
break;
case TYPES.FunctionType:
types.push(catharsis.stringify(parsedType));
break;
case TYPES.NameExpression:
types.push(parsedType.name);
break;
case TYPES.NullLiteral:
types.push('null');
break;
case TYPES.RecordType:
function getTypeStrings(parsedType, isOutermostType) {
let applications;
let typeString;
let types = [];
const TYPES = catharsis.Types;
switch (parsedType.type) {
case TYPES.AllLiteral:
types.push('*');
break;
case TYPES.FunctionType:
types.push('function');
break;
case TYPES.NameExpression:
types.push(parsedType.name);
break;
case TYPES.NullLiteral:
types.push('null');
break;
case TYPES.RecordType:
types.push('Object');
function getTypeStrings(parsedType, isOutermostType) {
var applications;
var typeString;
var types = [];
var TYPES = catharsis.Types;
switch (parsedType.type) {
case TYPES.AllLiteral:
types.push('*');
break;
case TYPES.FunctionType:
types.push('function');
break;
case TYPES.NameExpression:
types.push(parsedType.name);
break;
case TYPES.NullLiteral:
types.push('null');
break;
case TYPES.RecordType:
types.push('Object');