summaryrefslogtreecommitdiff
path: root/cli/js/compiler_api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/compiler_api.ts')
-rw-r--r--cli/js/compiler_api.ts12
1 files changed, 6 insertions, 6 deletions
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<string, string>,
- options?: CompilerOptions
+ options: CompilerOptions = {}
): Promise<Record<string, TranspileOnlyResult>> {
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<string, string>,
- options?: CompilerOptions
+ options: CompilerOptions = {}
): Promise<[DiagnosticItem[] | undefined, Record<string, string>]> {
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<string, string>,
- 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", {