mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
Organize dispatch a bit (#2796)
Just some clean up reorganization around flatbuffer/minimal dispatch code. This is prep for adding a JSON dispatcher.
This commit is contained in:
parent
b764d1b8ff
commit
bdc97b3976
65 changed files with 663 additions and 754 deletions
|
@ -1,7 +1,5 @@
|
|||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
import * as msg from "gen/cli/msg_generated";
|
||||
import * as flatbuffers from "./flatbuffers";
|
||||
import * as dispatch from "./dispatch";
|
||||
import { sendSync, sendAsync, msg, flatbuffers } from "./dispatch_flatbuffers";
|
||||
|
||||
export interface RemoveOption {
|
||||
recursive?: boolean;
|
||||
|
@ -25,7 +23,7 @@ function req(
|
|||
* Deno.removeSync("/path/to/dir/or/file", {recursive: false});
|
||||
*/
|
||||
export function removeSync(path: string, options: RemoveOption = {}): void {
|
||||
dispatch.sendSync(...req(path, options));
|
||||
sendSync(...req(path, options));
|
||||
}
|
||||
|
||||
/** Removes the named file or directory. Would throw error if
|
||||
|
@ -39,5 +37,5 @@ export async function remove(
|
|||
path: string,
|
||||
options: RemoveOption = {}
|
||||
): Promise<void> {
|
||||
await dispatch.sendAsync(...req(path, options));
|
||||
await sendAsync(...req(path, options));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue