From 151ce0266eb4de2c8fc600c81c192a5f791b6169 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 9 Oct 2019 17:10:09 -0400 Subject: Move everything into std subdir --- std/strings/encode.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 std/strings/encode.ts (limited to 'std/strings/encode.ts') diff --git a/std/strings/encode.ts b/std/strings/encode.ts new file mode 100644 index 000000000..285305613 --- /dev/null +++ b/std/strings/encode.ts @@ -0,0 +1,7 @@ +/** A default TextEncoder instance */ +export const encoder = new TextEncoder(); + +/** Shorthand for new TextEncoder().encode() */ +export function encode(input?: string): Uint8Array { + return encoder.encode(input); +} -- cgit v1.2.3