summaryrefslogtreecommitdiff
path: root/cli/js/stat.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/stat.ts
parent805992b14a65a6dbfb857dea6d9b657477de043d (diff)
Clean up how we use opIds (#4118)
Diffstat (limited to 'cli/js/stat.ts')
-rw-r--r--cli/js/stat.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/js/stat.ts b/cli/js/stat.ts
index b27170263..1fd28e893 100644
--- a/cli/js/stat.ts
+++ b/cli/js/stat.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";
import { FileInfo, FileInfoImpl } from "./file_info.ts";
export interface StatResponse {
@@ -30,7 +29,7 @@ export interface StatResponse {
* assert(fileInfo.isFile());
*/
export async function lstat(filename: string): Promise<FileInfo> {
- const res = (await sendAsync(dispatch.OP_STAT, {
+ const res = (await sendAsync("op_stat", {
filename,
lstat: true
})) as StatResponse;
@@ -45,7 +44,7 @@ export async function lstat(filename: string): Promise<FileInfo> {
* assert(fileInfo.isFile());
*/
export function lstatSync(filename: string): FileInfo {
- const res = sendSync(dispatch.OP_STAT, {
+ const res = sendSync("op_stat", {
filename,
lstat: true
}) as StatResponse;
@@ -59,7 +58,7 @@ export function lstatSync(filename: string): FileInfo {
* assert(fileInfo.isFile());
*/
export async function stat(filename: string): Promise<FileInfo> {
- const res = (await sendAsync(dispatch.OP_STAT, {
+ const res = (await sendAsync("op_stat", {
filename,
lstat: false
})) as StatResponse;
@@ -73,7 +72,7 @@ export async function stat(filename: string): Promise<FileInfo> {
* assert(fileInfo.isFile());
*/
export function statSync(filename: string): FileInfo {
- const res = sendSync(dispatch.OP_STAT, {
+ const res = sendSync("op_stat", {
filename,
lstat: false
}) as StatResponse;