swc/bundler/tests/deno-exec/deno-9620/case1/input/entry.ts
강동윤 bc07215d4d
fix(es/parser): Fix lexing of template literals. (#1450)
swc_ecma_parser:
 - Fix lexing of template literals. (denoland/deno#9620)
 - Ensure that denoland/deno#9650 is not a bug of parser.
2021-03-03 17:46:36 +09:00

23 lines
793 B
TypeScript

import { MultipartReader } from "https://deno.land/std@0.88.0/mime/multipart.ts";
import { StringReader } from "https://deno.land/std@0.88.0/io/readers.ts";
// carriage returns added for running on POSIX, not needed if on windows
const content = `--------------------------366796e1c748a2fb\r
Content-Disposition: form-data; name="payload"\r
Content-Type: text/plain\r
\r
CONTENT\r
--------------------------366796e1c748a2fb--`
const boundary = "------------------------366796e1c748a2fb";
console.log(content);
const stringReader = new StringReader(content);
const multipartReader = new MultipartReader(stringReader, boundary);
const formData = await multipartReader.readForm()
for (const entry of formData.entries()) {
console.log("entry", entry);
}
console.log("formdata", formData);