Skip to content

Commit

Permalink
adjusting indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SignpostMarv committed Sep 23, 2024
1 parent bee6612 commit 06d48ff
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions discover-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 06d48ff

Please sign in to comment.