diff options
Diffstat (limited to 'js/read_link.ts')
-rw-r--r-- | js/read_link.ts | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/js/read_link.ts b/js/read_link.ts index 6a518231f..b63fdd841 100644 --- a/js/read_link.ts +++ b/js/read_link.ts @@ -4,22 +4,6 @@ import * as flatbuffers from "./flatbuffers"; import { assert } from "./util"; import * as dispatch from "./dispatch"; -/** Returns the destination of the named symbolic link synchronously. - * - * const targetPath = Deno.readlinkSync("symlink/path"); - */ -export function readlinkSync(name: string): string { - return res(dispatch.sendSync(...req(name))); -} - -/** Returns the destination of the named symbolic link. - * - * const targetPath = await Deno.readlink("symlink/path"); - */ -export async function readlink(name: string): Promise<string> { - return res(await dispatch.sendAsync(...req(name))); -} - function req(name: string): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] { const builder = flatbuffers.createBuilder(); const name_ = builder.createString(name); @@ -38,3 +22,19 @@ function res(baseRes: null | msg.Base): string { assert(path !== null); return path!; } + +/** Returns the destination of the named symbolic link synchronously. + * + * const targetPath = Deno.readlinkSync("symlink/path"); + */ +export function readlinkSync(name: string): string { + return res(dispatch.sendSync(...req(name))); +} + +/** Returns the destination of the named symbolic link. + * + * const targetPath = await Deno.readlink("symlink/path"); + */ +export async function readlink(name: string): Promise<string> { + return res(await dispatch.sendAsync(...req(name))); +} |