mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 06:22:53 +00:00
fix: apply stricter tslint rules
This commit is contained in:
@@ -105,7 +105,7 @@ export async function createDiagramFromString(
|
||||
response = await request(url);
|
||||
const httpOK = 200;
|
||||
if (response.statusCode !== httpOK) {
|
||||
Logger.error(`Plantuml Server responded with an error.\n${response.statusMessage}`);
|
||||
await Logger.error(`Plantuml Server responded with an error.\n${response.statusMessage}`);
|
||||
throw new Error('Response not okay');
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -93,7 +93,7 @@ export function readAsEnumDefinition(
|
||||
);
|
||||
|
||||
// get enum values according to type
|
||||
if (declaration.kindString === 'Enumeration' && declaration.children) {
|
||||
if (declaration.kindString === 'Enumeration' && typeof declaration.children !== 'undefined') {
|
||||
// standard enumeration
|
||||
for (const child of declaration.children) {
|
||||
if (child.kindString === 'Enumeration member') {
|
||||
@@ -154,7 +154,7 @@ function getTypeInformation(type: LightweightType): string[] {
|
||||
export function readAsClassDefinition(
|
||||
declaration: DeclarationReflection,
|
||||
): LightweightClassDefinition {
|
||||
let type = declaration.kindString ? declaration.kindString.toLowerCase() : '';
|
||||
let type = typeof declaration.kindString !== 'undefined' ? declaration.kindString.toLowerCase() : '';
|
||||
type = (declaration.flags.isAbstract ? 'abstract ' : '') + type;
|
||||
|
||||
const classDefinition: LightweightClassDefinition = new LightweightClassDefinition(
|
||||
@@ -314,7 +314,7 @@ function readAsReferenceType(type: ReferenceType): LightweightType {
|
||||
const tempTypeReflection = type.reflection as DeclarationReflection;
|
||||
// interfaces and classes in a type are a sink, since their declaration are defined elsewhere
|
||||
if (
|
||||
tempTypeReflection.kindString &&
|
||||
typeof tempTypeReflection.kindString !== 'undefined' &&
|
||||
['Interface', 'Class', 'Enumeration', 'Type alias'].indexOf(
|
||||
tempTypeReflection.kindString,
|
||||
) > -1
|
||||
@@ -383,7 +383,7 @@ function readAsUnionType(type: UnionType): LightweightType {
|
||||
*/
|
||||
function readAsReflectionType(type: ReflectionType): LightweightType {
|
||||
const returnType: LightweightType = new LightweightType();
|
||||
if (type.declaration.sources) {
|
||||
if (typeof type.declaration.sources !== 'undefined') {
|
||||
const src = type.declaration.sources[0];
|
||||
Logger.warn(
|
||||
`${src.line} : ${src.fileName}: Reflection Type not recognized. Refactoring to explicit class is advised.`,
|
||||
|
||||
Reference in New Issue
Block a user