@@ -53,7 +53,7 @@ class UploadError extends Error {
5353
5454 title = {
5555 en : `Error Occurred Downloading Sample Template` ,
56- fr : `Un occurence d'un erreur quand le csv est telecharger `
56+ fr : `Une erreur s'est produite lors du téléchargement du CSV `
5757 } ;
5858
5959 constructor ( description : { [ L in Language ] ?: string } ) {
@@ -250,7 +250,13 @@ namespace Zod3 {
250250 case 'ZodEnum' :
251251 try {
252252 let possibleEnumOutputs = '' ;
253- for ( const val of enumValues ! ) {
253+ if ( ! enumValues ) {
254+ throw new UploadError ( {
255+ en : 'Enum values do not exist' ,
256+ fr : `Values d'Enum n'existe pas`
257+ } ) ;
258+ }
259+ for ( const val of enumValues ) {
254260 possibleEnumOutputs += val + '/' ;
255261 }
256262 possibleEnumOutputs = possibleEnumOutputs . slice ( 0 , - 1 ) ;
@@ -317,8 +323,6 @@ namespace Zod3 {
317323 sampleData . push ( generateSampleData ( typeNameResult ) ) ;
318324 }
319325
320- unparse ( [ csvColumns , sampleData ] ) ;
321-
322326 return {
323327 content : unparse ( [ csvColumns , sampleData ] ) ,
324328 filename : getTemplateFilename ( instrumentInternal )
@@ -730,11 +734,13 @@ namespace Zod4 {
730734 if ( propertySchema . type === 'array' ) {
731735 if ( ! propertySchema . items ) {
732736 throw new UploadError ( {
733- en : "Property 'items' must be defined for array schema"
737+ en : "Property 'items' must be defined for array schema" ,
738+ fr : "La propriété 'items' doit être définie pour le schéma de tableau"
734739 } ) ;
735740 } else if ( Array . isArray ( propertySchema . items ) ) {
736741 throw new UploadError ( {
737- en : "Property 'items' must not be array: only JSON schema 2020 or later is supported"
742+ en : "Property 'items' must not be array: only JSON schema 2020 or later is supported" ,
743+ fr : `Le schéma de validation du formulaire devrait être de type object, reçu ${ jsonInstrumentSchema . type } `
738744 } ) ;
739745 }
740746 const itemsSchema = propertySchema . items as z4 . core . JSONSchema . ObjectSchema ;
0 commit comments