From 6443e4aed16868c17111a56634aa733211430f46 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 10 Mar 2020 16:08:58 +0000 Subject: refactor: Cleanup options object parameters (#4296) --- cli/js/compiler_api.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cli/js/compiler_api.ts') diff --git a/cli/js/compiler_api.ts b/cli/js/compiler_api.ts index b7c4e83e8..8282f0717 100644 --- a/cli/js/compiler_api.ts +++ b/cli/js/compiler_api.ts @@ -302,12 +302,12 @@ export interface TranspileOnlyResult { */ export async function transpileOnly( sources: Record, - options?: CompilerOptions + options: CompilerOptions = {} ): Promise> { util.log("Deno.transpileOnly", { sources: Object.keys(sources), options }); const payload = { sources, - options: options ? JSON.stringify(options) : undefined + options: JSON.stringify(options) }; const result = await runtimeCompilerOps.transpile(payload); return JSON.parse(result); @@ -343,12 +343,12 @@ export async function transpileOnly( export async function compile( rootName: string, sources?: Record, - options?: CompilerOptions + options: CompilerOptions = {} ): Promise<[DiagnosticItem[] | undefined, Record]> { const payload = { rootName: sources ? rootName : checkRelative(rootName), sources, - options: options ? JSON.stringify(options) : undefined, + options: JSON.stringify(options), bundle: false }; util.log("Deno.compile", { @@ -391,12 +391,12 @@ export async function compile( export async function bundle( rootName: string, sources?: Record, - options?: CompilerOptions + options: CompilerOptions = {} ): Promise<[DiagnosticItem[] | undefined, string]> { const payload = { rootName: sources ? rootName : checkRelative(rootName), sources, - options: options ? JSON.stringify(options) : undefined, + options: JSON.stringify(options), bundle: true }; util.log("Deno.bundle", { -- cgit v1.2.3