From 603e4717f820331cbd26a3fbfb1df3eb4422a325 Mon Sep 17 00:00:00 2001 From: eliassjogreen Date: Tue, 2 Feb 2021 18:57:56 +0100 Subject: [PATCH] chore: remove deps, replace with util file --- deps.ts | 1 - tty_async.ts | 2 +- tty_sync.ts | 2 +- util.ts | 5 +++++ 4 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 deps.ts create mode 100644 util.ts diff --git a/deps.ts b/deps.ts deleted file mode 100644 index 8243dfd..0000000 --- a/deps.ts +++ /dev/null @@ -1 +0,0 @@ -export { encode, decode } from "https://deno.land/std@0.78.0/encoding/utf8.ts"; diff --git a/tty_async.ts b/tty_async.ts index 4ed2b8d..a053745 100644 --- a/tty_async.ts +++ b/tty_async.ts @@ -1,4 +1,4 @@ -import { encode } from "./deps.ts"; +import { encode } from "./util.ts"; import { AsyncStream, diff --git a/tty_sync.ts b/tty_sync.ts index 8fcb760..803bbc1 100644 --- a/tty_sync.ts +++ b/tty_sync.ts @@ -1,4 +1,4 @@ -import { encode } from "./deps.ts"; +import { encode } from "./util.ts"; import { SyncStream, diff --git a/util.ts b/util.ts new file mode 100644 index 0000000..89415f0 --- /dev/null +++ b/util.ts @@ -0,0 +1,5 @@ +export const encoder = new TextEncoder(); + +export function encode(input?: string): Uint8Array { + return encoder.encode(input); +}