File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -152,13 +152,14 @@ function extractRecordArrayEntry(entry: string): { [key: string]: string }[] {
152152 const records : { [ key : string ] : string } = { } ;
153153 recordsList . forEach ( ( rawRecord , i ) => {
154154 const [ recordKey , recordValue ] = rawRecord . split ( ':' ) . map ( ( s ) => s . trim ( ) ) ;
155- if ( ! ( recordKey && recordValue ) ) {
155+ if ( ! recordKey ) {
156156 throw new UploadError ( {
157157 en : `Malformed record at index ${ i } ` ,
158158 fr : `Enregistrement mal formé à l'index ${ i } `
159159 } ) ;
160160 }
161- records [ recordKey ] = recordValue ;
161+ //recordValue can be empty if the value is optional
162+ records [ recordKey ] = recordValue ! ;
162163 } ) ;
163164 return records ;
164165 } ) ;
@@ -397,6 +398,7 @@ export namespace Zod3 {
397398 fr : "Les clés ou valeurs du tableau d'enregistrements n'existent pas"
398399 } ) ;
399400 }
401+
400402 return extractRecordArrayEntry ( entry ) . map ( ( parsedRecord ) => {
401403 const result : { [ key : string ] : unknown } = { } ;
402404 convertResult . multiKeys ! . forEach ( ( key , index ) => {
You can’t perform that action at this time.
0 commit comments