summaryrefslogtreecommitdiff
path: root/cli/js/truncate.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-02-25 09:14:27 -0500
committerGitHub <noreply@github.com>2020-02-25 09:14:27 -0500
commit91b606aaae23bcb790b55adc5fe70a182a37d564 (patch)
tree16b56a21ffcb3991569eda984fbd14073bdbd3ae /cli/js/truncate.ts
parent805992b14a65a6dbfb857dea6d9b657477de043d (diff)
Clean up how we use opIds (#4118)
Diffstat (limited to 'cli/js/truncate.ts')
-rw-r--r--cli/js/truncate.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/js/truncate.ts b/cli/js/truncate.ts
index bd572e75a..17c08674c 100644
--- a/cli/js/truncate.ts
+++ b/cli/js/truncate.ts
@@ -1,6 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { sendSync, sendAsync } from "./dispatch_json.ts";
-import * as dispatch from "./dispatch.ts";
function coerceLen(len?: number): number {
if (!len) {
@@ -20,7 +19,7 @@ function coerceLen(len?: number): number {
* Deno.truncateSync("hello.txt", 10);
*/
export function truncateSync(name: string, len?: number): void {
- sendSync(dispatch.OP_TRUNCATE, { name, len: coerceLen(len) });
+ sendSync("op_truncate", { name, len: coerceLen(len) });
}
/**
@@ -30,5 +29,5 @@ export function truncateSync(name: string, len?: number): void {
* await Deno.truncate("hello.txt", 10);
*/
export async function truncate(name: string, len?: number): Promise<void> {
- await sendAsync(dispatch.OP_TRUNCATE, { name, len: coerceLen(len) });
+ await sendAsync("op_truncate", { name, len: coerceLen(len) });
}