1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-26 09:10:40 -05:00

Fix example code of writeFile (#1626)

According to spec, `TextEncoder()` takes no parameters. However `TextEncoder("utf-8")` is written in example codes.

Spec of TextEncoder: https://www.w3.org/TR/encoding/#interface-textencoder
MDN: https://developer.mozilla.org/ja/docs/Web/API/TextEncoder/TextEncoder#Parameters
This commit is contained in:
Masashi Hirano 2019-01-31 00:44:40 +09:00 committed by Ryan Dahl
parent 1681bda14d
commit 02b9046a0e

View file

@ -7,7 +7,7 @@ import * as dispatch from "./dispatch";
*
* import { writeFileSync } from "deno";
*
* const encoder = new TextEncoder("utf-8");
* const encoder = new TextEncoder();
* const data = encoder.encode("Hello world\n");
* writeFileSync("hello.txt", data);
*/
@ -23,7 +23,7 @@ export function writeFileSync(
*
* import { writeFile } from "deno";
*
* const encoder = new TextEncoder("utf-8");
* const encoder = new TextEncoder();
* const data = encoder.encode("Hello world\n");
* await writeFile("hello.txt", data);
*/