summaryrefslogtreecommitdiff
path: root/cli/js/compiler_api.ts
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2020-07-14 15:24:17 -0400
committerGitHub <noreply@github.com>2020-07-14 15:24:17 -0400
commitcde4dbb35132848ffece59ef9cfaccff32347124 (patch)
treecc7830968c6decde704c8cfb83c9185193dc698f /cli/js/compiler_api.ts
parent9eca71caa1674c31f9cc5d4e86c03f10b59e0a00 (diff)
Use dprint for internal formatting (#6682)
Diffstat (limited to 'cli/js/compiler_api.ts')
-rw-r--r--cli/js/compiler_api.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/cli/js/compiler_api.ts b/cli/js/compiler_api.ts
index 8a50e0b3d..e0488b7f6 100644
--- a/cli/js/compiler_api.ts
+++ b/cli/js/compiler_api.ts
@@ -18,7 +18,7 @@ function checkRelative(specifier: string): string {
// TODO(bartlomieju): change return type to interface?
export function transpileOnly(
sources: Record<string, string>,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
): Promise<Record<string, TranspileOnlyResult>> {
util.log("Deno.transpileOnly", { sources: Object.keys(sources), options });
const payload = {
@@ -32,7 +32,7 @@ export function transpileOnly(
export async function compile(
rootName: string,
sources?: Record<string, string>,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
): Promise<[DiagnosticItem[] | undefined, Record<string, string>]> {
const payload = {
rootName: sources ? rootName : checkRelative(rootName),
@@ -47,8 +47,9 @@ export async function compile(
});
const result = await runtimeCompilerOps.compile(payload);
util.assert(result.emitMap);
- const maybeDiagnostics =
- result.diagnostics.length === 0 ? undefined : result.diagnostics;
+ const maybeDiagnostics = result.diagnostics.length === 0
+ ? undefined
+ : result.diagnostics;
const emitMap: Record<string, string> = {};
@@ -63,7 +64,7 @@ export async function compile(
export async function bundle(
rootName: string,
sources?: Record<string, string>,
- options: CompilerOptions = {}
+ options: CompilerOptions = {},
): Promise<[DiagnosticItem[] | undefined, string]> {
const payload = {
rootName: sources ? rootName : checkRelative(rootName),
@@ -78,7 +79,8 @@ export async function bundle(
});
const result = await runtimeCompilerOps.compile(payload);
util.assert(result.output);
- const maybeDiagnostics =
- result.diagnostics.length === 0 ? undefined : result.diagnostics;
+ const maybeDiagnostics = result.diagnostics.length === 0
+ ? undefined
+ : result.diagnostics;
return [maybeDiagnostics, result.output];
}