summaryrefslogtreecommitdiff
path: root/js/remove.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-03-10 04:30:38 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-03-09 12:30:38 -0500
commit034e2cc02829c9244b32232074c7a48af827a2fb (patch)
treebade01606a1ee076c1f753ce99c97ddb1e4edf30 /js/remove.ts
parent8c7a12d1b258f0ef5ab27f49c424331d43e8d97f (diff)
Migrate from tslint to eslint for linting (#1905)
Diffstat (limited to 'js/remove.ts')
-rw-r--r--js/remove.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/js/remove.ts b/js/remove.ts
index 89c2ba672..1c9df6830 100644
--- a/js/remove.ts
+++ b/js/remove.ts
@@ -7,6 +7,19 @@ export interface RemoveOption {
recursive?: boolean;
}
+function req(
+ path: string,
+ options: RemoveOption
+): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] {
+ const builder = flatbuffers.createBuilder();
+ const path_ = builder.createString(path);
+ msg.Remove.startRemove(builder);
+ msg.Remove.addPath(builder, path_);
+ msg.Remove.addRecursive(builder, !!options.recursive);
+ const inner = msg.Remove.endRemove(builder);
+ return [builder, msg.Any.Remove, inner];
+}
+
/** Removes the named file or directory synchronously. Would throw
* error if permission denied, not found, or directory not empty if `recursive`
* set to false.
@@ -31,16 +44,3 @@ export async function remove(
): Promise<void> {
await dispatch.sendAsync(...req(path, options));
}
-
-function req(
- path: string,
- options: RemoveOption
-): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] {
- const builder = flatbuffers.createBuilder();
- const path_ = builder.createString(path);
- msg.Remove.startRemove(builder);
- msg.Remove.addPath(builder, path_);
- msg.Remove.addRecursive(builder, !!options.recursive);
- const inner = msg.Remove.endRemove(builder);
- return [builder, msg.Any.Remove, inner];
-}