@@ -149,12 +149,14 @@ function _parseFormData<T extends Record<string, unknown>>(
149149 options ?: SuperValidateOptions < T >
150150) {
151151 const output : Record < string , unknown > = { } ;
152- const schemaKeys = new Set (
153- [
154- ...Object . keys ( schema . properties ?? { } ) ,
155- ...( schema . additionalProperties ? formData . keys ( ) : [ ] )
156- ] . filter ( ( key ) => ! key . startsWith ( '__superform_' ) )
157- ) ;
152+ const schemaKeys = options ?. strict
153+ ? new Set ( [ ...formData . keys ( ) ] . filter ( ( key ) => ! key . startsWith ( '__superform_' ) ) )
154+ : new Set (
155+ [
156+ ...Object . keys ( schema . properties ?? { } ) ,
157+ ...( schema . additionalProperties ? formData . keys ( ) : [ ] )
158+ ] . filter ( ( key ) => ! key . startsWith ( '__superform_' ) )
159+ ) ;
158160
159161 function parseSingleEntry ( key : string , entry : FormDataEntryValue , info : SchemaInfo ) {
160162 if ( options ?. preprocessed && options . preprocessed . includes ( key as keyof T ) ) {
@@ -246,7 +248,7 @@ function parseFormDataEntry(
246248 info : SchemaInfo
247249) : unknown {
248250 if ( ! value ) {
249- //console.log(`No FormData for "${key}" (${type}).`, info); //debug
251+ //console.log(`No FormData for "${key}" (${type}).`, info, strict ); //debug
250252
251253 // Special case for booleans with default value true
252254 if ( type == 'boolean' && info . isOptional && info . schema . default === true ) {
0 commit comments