Use dprint for internal formatting (#6682)

This commit is contained in:
David Sherret 2020-07-14 15:24:17 -04:00 committed by GitHub
parent 9eca71caa1
commit cde4dbb351
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
378 changed files with 3116 additions and 3121 deletions

View file

@ -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];
}