From 6b0cecae887cb22729e005e4268401b7c625a42a Mon Sep 17 00:00:00 2001 From: Shinigami Date: Sun, 6 Aug 2023 14:24:10 +0200 Subject: chore(deps): update dependency prettier to v3 (#2260) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ST-DDT --- scripts/apidoc/moduleMethods.ts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'scripts/apidoc/moduleMethods.ts') diff --git a/scripts/apidoc/moduleMethods.ts b/scripts/apidoc/moduleMethods.ts index 65a62528..359282dc 100644 --- a/scripts/apidoc/moduleMethods.ts +++ b/scripts/apidoc/moduleMethods.ts @@ -23,8 +23,10 @@ import { adjustUrls } from './utils'; * @param project The project used to extract the modules. * @returns The generated pages. */ -export function processModules(project: ProjectReflection): ModuleSummary[] { - return selectApiModules(project).map(processModule); +export async function processModules( + project: ProjectReflection +): Promise { + return Promise.all(selectApiModules(project).map(processModule)); } /** @@ -33,12 +35,17 @@ export function processModules(project: ProjectReflection): ModuleSummary[] { * @param module The module to process. * @returns The generated pages. */ -function processModule(module: DeclarationReflection): ModuleSummary { +async function processModule( + module: DeclarationReflection +): Promise { const moduleName = extractModuleName(module); console.log(`Processing Module ${moduleName}`); const moduleFieldName = extractModuleFieldName(module); const { comment, deprecated } = analyzeModule(module); - const methods = processModuleMethods(module, `faker.${moduleFieldName}.`); + const methods = await processModuleMethods( + module, + `faker.${moduleFieldName}.` + ); return writeApiDocsModule( moduleName, @@ -72,10 +79,10 @@ export function analyzeModule(module: DeclarationReflection): { * @param accessor The code used to access the methods within the module. * @returns A list containing the documentation for the api methods in the given module. */ -export function processModuleMethods( +export async function processModuleMethods( module: DeclarationReflection, accessor: string -): Method[] { +): Promise { return processMethods(selectApiMethodSignatures(module), accessor); } @@ -86,15 +93,15 @@ export function processModuleMethods( * @param accessor The code used to access the methods. * @returns A list containing the documentation for the api methods. */ -export function processMethods( +export async function processMethods( signatures: Record, accessor: string = '' -): Method[] { +): Promise { const methods: Method[] = []; for (const [methodName, signature] of Object.entries(signatures)) { console.debug(`- ${methodName}`); - methods.push(analyzeSignature(signature, accessor, methodName)); + methods.push(await analyzeSignature(signature, accessor, methodName)); } return methods; -- cgit v1.2.3