File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed
Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export class FormDataEncoder {
6666 *
6767 * const encoder = new Encoder(fd)
6868 */
69- constructor ( form : FormDataLike , boundary : string = createBoundary ( 16 ) ) {
69+ constructor ( form : FormDataLike , boundary : string = createBoundary ( ) ) {
7070 if ( ! isFormData ( form ) ) {
7171 throw new TypeError ( "Expected first argument to be a FormData instance." )
7272 }
Original file line number Diff line number Diff line change @@ -3,20 +3,13 @@ import test from "ava"
33import createBoundary from "./createBoundary"
44
55test ( "Returns a string" , t => {
6- const actual = createBoundary ( 16 )
6+ const actual = createBoundary ( )
77
88 t . is ( typeof actual , "string" )
99} )
1010
11- test ( "Returns a string of given length" , t => {
12- const expected = 24
13- const actual = createBoundary ( expected )
14-
15- t . is ( actual . length , expected )
16- } )
17-
1811test ( "Returns a string that passes regex of valid range" , t => {
19- const actual = createBoundary ( 16 )
12+ const actual = createBoundary ( )
2013
2114 t . regex ( actual , / ^ [ a - z A - Z 0 - 9 ' _ - ] + $ / )
2215} )
Original file line number Diff line number Diff line change @@ -3,10 +3,9 @@ const alphabet
33
44/**
55 * Generates a boundary string for FormData encoder.
6- *
7- * @param size The size of the resulting string
86 */
9- function createBoundary ( size : number ) : string {
7+ function createBoundary ( ) : string {
8+ let size = 16
109 let res = ""
1110
1211 while ( size -- ) {
You can’t perform that action at this time.
0 commit comments