mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -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:
parent
1681bda14d
commit
02b9046a0e
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue