From 5709fdf14c416f21f6142805d0335018c0037fc0 Mon Sep 17 00:00:00 2001 From: "yamamoto.taizo" Date: Thu, 16 Sep 2021 20:02:03 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/default.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/template/default.ts b/template/default.ts index b51443b..c0bd7e5 100644 --- a/template/default.ts +++ b/template/default.ts @@ -1,12 +1,12 @@ // main (async () => { // util for input - const rl = require('readline').createInterface({ input: process.stdin }); - const lineiter = rl[Symbol.asyncIterator](); - const readiter = (async function* () { for await (const line of lineiter) for (const word of line.split(" ")) yield await word; })(); - const chariter = (async function* () { for await (const line of lineiter) for (const word of line.split(" ")) for (const char of word.split("")) yield await char; })(); - const read = async () => String((await readiter.next()).value); - const readchar = async () => String((await chariter.next()).value); + const rl = require("readline").createInterface({ input: process.stdin }); + const lineit = rl[Symbol.asyncIterator](); + const wordit = (async function* () { for await (const line of lineit) for (const word of line.split(" ")) yield await word; })(); + const charit = (async function* () { for await (const line of lineit) for (const word of line.split(" ")) for (const char of word.split("")) yield await char; })(); + const read = async () => String((await wordit.next()).value); + const readchar = async () => String((await charit.next()).value); // util for es6 const fromto = function* (from: number, to: number, step = 1) { for (let x = from; x <= to; x += step) yield x; };