diff --git a/bin/typedoc b/bin/typedoc index be0dc0a8f..dad5e7ed1 100755 --- a/bin/typedoc +++ b/bin/typedoc @@ -66,8 +66,7 @@ async function run(app) { } const json = app.options.getValue("json"); if (json) { - const pretty = app.options.getValue("pretty"); - await app.generateJson(project, json, pretty); + await app.generateJson(project, json); } if (!out && !json) { @@ -88,8 +87,7 @@ async function run(app) { } const json = app.options.getValue("json"); if (json) { - const pretty = app.options.getValue("pretty"); - await app.generateJson(project, json, pretty); + await app.generateJson(project, json); } if (!out && !json) { diff --git a/scripts/rebuild_specs.js b/scripts/rebuild_specs.js index 52ecd5099..98956b845 100644 --- a/scripts/rebuild_specs.js +++ b/scripts/rebuild_specs.js @@ -107,7 +107,7 @@ async function rebuildRendererTest() { app.options.setValue("entryPoints", app.expandInputFiles([src])); const project = app.convert(); await app.generateDocs(project, out); - await app.generateJson(project, path.join(out, "specs.json"), true); + await app.generateJson(project, path.join(out, "specs.json")); /** * Avoiding sync methods here is... difficult. diff --git a/src/lib/application.ts b/src/lib/application.ts index 88ef7c62a..d70a83052 100644 --- a/src/lib/application.ts +++ b/src/lib/application.ts @@ -388,13 +388,11 @@ export class Application extends ChildableComponent< * Run the converter for the given set of files and write the reflections to a json file. * * @param out The path and file name of the target file. - * @param format Whether the JSON data should be formatted with tabs. * @returns Whether the JSON file could be written successfully. */ public async generateJson( project: ProjectReflection, - out: string, - format = true + out: string ): Promise { out = Path.resolve(out); const eventData = { @@ -406,7 +404,7 @@ export class Application extends ChildableComponent< end: eventData, }); - const space = format ? "\t" : ""; + const space = this.application.options.getValue("pretty") ? "\t" : ""; await FS.promises.writeFile(out, JSON.stringify(ser, null, space)); this.logger.success("JSON written to %s", out); }