mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
15 lines
342 B
TypeScript
15 lines
342 B
TypeScript
|
// Loaded from https://deno.land/x/deno_image@v0.0.3/lib/decoders/fast-png/iobuffer/utf8.ts
|
||
|
|
||
|
|
||
|
const decoder = new TextDecoder('utf-8');
|
||
|
|
||
|
export function decode(bytes: Uint8Array): string {
|
||
|
return decoder.decode(bytes);
|
||
|
}
|
||
|
|
||
|
const encoder = new TextEncoder();
|
||
|
|
||
|
export function encode(str: string): Uint8Array {
|
||
|
return encoder.encode(str);
|
||
|
}
|