From 06d48ff519c87dcaf7aa87456d395f130fab121b Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Mon, 23 Sep 2024 12:23:44 +0000 Subject: [PATCH] adjusting indentation --- discover-types.ts | 96 +++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/discover-types.ts b/discover-types.ts index 86ac2902..514b3511 100644 --- a/discover-types.ts +++ b/discover-types.ts @@ -26,56 +26,56 @@ const perf = setup_PerformanceObserver(); const version = 'update8'; const sub_path = versions.update8; - try { - performance.mark('start'); - const bar = new TypeDefinitionWriter( - docs, - version, - ); - performance.measure('bootstrap', 'start'); - performance.mark('bootstrap done'); - await bar.write(`${__dirname}/generated-types/${sub_path}/`); - performance.measure('types generated', 'bootstrap done'); - const discovery = await bar.discovery; - const result = await discovery.discover_type_$defs(); +try { + performance.mark('start'); + const bar = new TypeDefinitionWriter( + docs, + version, + ); + performance.measure('bootstrap', 'start'); + performance.mark('bootstrap done'); + await bar.write(`${__dirname}/generated-types/${sub_path}/`); + performance.measure('types generated', 'bootstrap done'); + const discovery = await bar.discovery; + const result = await discovery.discover_type_$defs(); - process.stdout.write( - `${ - JSON.stringify(result.missing_classes, null, '\t') - }\n`, - ); - console.table({ - 'Found Types': Object.keys(result.found_types).length, - 'Missing Types': result.missing_types.length, - 'Found Classes': result.found_classes.length, - 'Missing Classes': result.missing_classes.length, - }); - await writeFile( - `${__dirname}/discover-types.${sub_path}.perf.json`, - `${JSON.stringify(perf(), null, '\t')}`, - ); - } catch (err) { + process.stdout.write( + `${ + JSON.stringify(result.missing_classes, null, '\t') + }\n`, + ); + console.table({ + 'Found Types': Object.keys(result.found_types).length, + 'Missing Types': result.missing_types.length, + 'Found Classes': result.found_classes.length, + 'Missing Classes': result.missing_classes.length, + }); + await writeFile( + `${__dirname}/discover-types.${sub_path}.perf.json`, + `${JSON.stringify(perf(), null, '\t')}`, + ); +} catch (err) { + await writeFile( + `${__dirname}/discover-types.${sub_path}.perf.json`, + `${JSON.stringify(perf(), null, '\t')}`, + ); + if (err instanceof NoMatchError) { + console.error('ran into an issue'); await writeFile( - `${__dirname}/discover-types.${sub_path}.perf.json`, - `${JSON.stringify(perf(), null, '\t')}`, + `./discovery-types.${sub_path}.failure.json`, + JSON.stringify( + { + property: err.property as unknown, + message: err.message, + stack: err.stack?.split('\n'), + }, + null, + '\t', + ), ); - if (err instanceof NoMatchError) { - console.error('ran into an issue'); - await writeFile( - `./discovery-types.${sub_path}.failure.json`, - JSON.stringify( - { - property: err.property as unknown, - message: err.message, - stack: err.stack?.split('\n'), - }, - null, - '\t', - ), - ); - console.error(err.message, err.stack); - } else { - throw err; - } + console.error(err.message, err.stack); + } else { + throw err; } +}