@@ -351,6 +351,24 @@ describe("parse values", () => {
351
351
const res : Record < string , Record < string , any > > = hydrateRow ( row , meta , { } ) ;
352
352
expect ( res [ "s" ] ) . toEqual ( { a : [ 1 , null ] , b : { c : null } } ) ;
353
353
} ) ;
354
+ it ( "parses nested struct with single struct correctly" , ( ) => {
355
+ const row = {
356
+ s : { a : { "c d" : null } }
357
+ } ;
358
+ const meta = [ { name : "s" , type : "struct(a struct(`c d` text null))" } ] ;
359
+ const res : Record < string , Record < string , any > > = hydrateRow ( row , meta , { } ) ;
360
+ expect ( res [ "s" ] ) . toEqual ( { a : { "c d" : null } } ) ;
361
+ } ) ;
362
+ it ( "parses nested struct with single struct mixed quoting" , ( ) => {
363
+ const row = {
364
+ s : { a : { e : "test" , "c d" : null } }
365
+ } ;
366
+ const meta = [
367
+ { name : "s" , type : "struct(a struct(e text,`c d` text null))" }
368
+ ] ;
369
+ const res : Record < string , Record < string , any > > = hydrateRow ( row , meta , { } ) ;
370
+ expect ( res [ "s" ] ) . toEqual ( { a : { e : "test" , "c d" : null } } ) ;
371
+ } ) ;
354
372
it ( "does not break on malformed struct" , ( ) => {
355
373
const row = {
356
374
s : { a : [ 1 , 2 ] , b : "hello" }
0 commit comments