mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* Copyright (C) 2018-2019 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
@@ -29,6 +29,10 @@ import {RouteWithMetaInformation} from './common';
|
||||
export async function gatherRouteInformation(reflection: ProjectReflection): Promise<RouteWithMetaInformation[]> {
|
||||
const routes: RouteWithMetaInformation[] = [];
|
||||
|
||||
if (!Array.isArray(reflection.children)) {
|
||||
throw new Error('Project reflection doesn\'t contain any modules.');
|
||||
}
|
||||
|
||||
await asyncPool(2, reflection.children, async (module: any) => {
|
||||
if (Array.isArray(module.children) && module.children.length > 0) {
|
||||
await asyncPool(2, module.children, (async (node: any) => {
|
||||
@@ -49,6 +53,10 @@ export async function gatherRouteInformation(reflection: ProjectReflection): Pro
|
||||
}
|
||||
});
|
||||
|
||||
if (routes.length === 0) {
|
||||
throw new Error('No route information found.');
|
||||
}
|
||||
|
||||
return routes;
|
||||
}
|
||||
|
||||
@@ -163,6 +171,10 @@ export function generateDocumentationForRoute(routeWithInfo: RouteWithMetaInform
|
||||
export function getNodeMetaInformationMap(projectReflection: ProjectReflection): NodesWithMetaInformation {
|
||||
const nodes: NodesWithMetaInformation = {};
|
||||
|
||||
if (typeof projectReflection.children === 'undefined') {
|
||||
throw new Error('Project reflection doesn\'t contain any modules.');
|
||||
}
|
||||
|
||||
// iterate over modules
|
||||
projectReflection.children.forEach((module: any) => {
|
||||
if (Array.isArray(module.children) && module.children.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user