mirror of
https://github.com/denoland/deno.git
synced 2025-10-05 08:30:22 +00:00
Use dprint for internal formatting (#6682)
This commit is contained in:
parent
9eca71caa1
commit
cde4dbb351
378 changed files with 3116 additions and 3121 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue