diff options
Diffstat (limited to 'std/strings/encode.ts')
m--------- | std | 0 | ||||
-rw-r--r-- | std/strings/encode.ts | 7 |
2 files changed, 7 insertions, 0 deletions
diff --git a/std b/std deleted file mode 160000 -Subproject 43aafbf33285753e7b42230f0eb7969b300f71c 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); +} |