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/decode.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 std/strings/decode.ts (limited to 'std/strings/decode.ts') diff --git a/std/strings/decode.ts b/std/strings/decode.ts new file mode 100644 index 000000000..2e161d7af --- /dev/null +++ b/std/strings/decode.ts @@ -0,0 +1,7 @@ +/** A default TextDecoder instance */ +export const decoder = new TextDecoder(); + +/** Shorthand for new TextDecoder().decode() */ +export function decode(input?: Uint8Array): string { + return decoder.decode(input); +} -- cgit v1.2.3