mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
style: apply strict style rules for this feature
This commit is contained in:
@@ -21,7 +21,7 @@ import {join, sep} from 'path';
|
||||
import {Definition} from 'ts-json-schema-generator';
|
||||
import {Application, ProjectReflection} from 'typedoc';
|
||||
import {promisify} from 'util';
|
||||
import {LightweightType} from './uml/model/LightweightType';
|
||||
import {LightweightType} from './uml/model/lightweight-type';
|
||||
|
||||
export const globPromisified = promisify(glob);
|
||||
export const mkdirPromisified = promisify(mkdir);
|
||||
@@ -143,7 +143,7 @@ export interface ExpectableValidationErrors {
|
||||
*
|
||||
* @param srcPath Path to get reflection from
|
||||
*/
|
||||
export function getProjectReflection(srcPath: PathLike, excludeExternals: boolean = true): ProjectReflection {
|
||||
export function getProjectReflection(srcPath: PathLike, excludeExternals = true): ProjectReflection {
|
||||
Logger.info(`Generating project reflection for ${srcPath.toString()}.`);
|
||||
|
||||
const tsconfigPath = getTsconfigPath(srcPath.toString());
|
||||
@@ -254,13 +254,14 @@ export function getFullTypeName(type: LightweightType): string {
|
||||
}
|
||||
if (type.isLiteral) {
|
||||
// literals are a sink
|
||||
return "'" + fullName + "'";
|
||||
return `'${fullName}'`;
|
||||
}
|
||||
if (type.isUnion && type.specificationTypes.length > 0) {
|
||||
const tempNames: string[] = [];
|
||||
for (const easyType of type.specificationTypes) {
|
||||
tempNames.push(getFullTypeName(easyType));
|
||||
}
|
||||
|
||||
// since unions can't be applied to other types, it is a sink.
|
||||
return tempNames.join(' | ');
|
||||
}
|
||||
@@ -270,11 +271,12 @@ export function getFullTypeName(type: LightweightType): string {
|
||||
for (const easyType of type.genericsTypes) {
|
||||
tempNames.push(getFullTypeName(easyType));
|
||||
}
|
||||
fullName += '<' + tempNames.join(', ') + '>';
|
||||
fullName = `${fullName}<${tempNames.join(', ')}>`;
|
||||
}
|
||||
// check if type is array
|
||||
if (type.isArray) {
|
||||
fullName += '[]';
|
||||
}
|
||||
|
||||
return fullName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user