@@ -55,7 +55,7 @@ export function generateScript(
5555 try {
5656 const structure = buildDocumentStructure ( schema ) ;
5757
58- const documentCode = generateDocumentCode (
58+ const documentCode = renderDocumentCode (
5959 structure ,
6060 INDENT_SIZE * 2 , // 4 spaces: 2 for function body + 2 for inside return statement
6161 options . arrayLengthMap
@@ -315,7 +315,7 @@ function insertIntoStructure(
315315/**
316316 * Generate JavaScript object code from document structure
317317 */
318- function generateDocumentCode (
318+ function renderDocumentCode (
319319 structure : DocumentStructure ,
320320 indent : number = INDENT_SIZE ,
321321 arrayLengthMap : ArrayLengthMap = { }
@@ -356,7 +356,7 @@ function generateDocumentCode(
356356 }
357357 } else if ( 'type' in value && value . type === 'array' ) {
358358 // It's an array
359- const arrayCode = generateArrayCode (
359+ const arrayCode = renderArrayCode (
360360 value as ArrayStructure ,
361361 indent + INDENT_SIZE ,
362362 fieldName ,
@@ -375,7 +375,7 @@ function generateDocumentCode(
375375 ? arrayInfo . elements
376376 : { } ;
377377
378- const nestedCode = generateDocumentCode (
378+ const nestedCode = renderDocumentCode (
379379 value as DocumentStructure ,
380380 indent + INDENT_SIZE ,
381381 nestedArrayLengthMap
@@ -395,7 +395,7 @@ function generateDocumentCode(
395395/**
396396 * Generate array code
397397 */
398- function generateArrayCode (
398+ function renderArrayCode (
399399 arrayStructure : ArrayStructure ,
400400 indent : number = INDENT_SIZE ,
401401 fieldName : string = '' ,
@@ -422,7 +422,7 @@ function generateArrayCode(
422422 return `Array.from({length: ${ arrayLength } }, () => ${ fakerCall } )` ;
423423 } else if ( 'type' in elementType && elementType . type === 'array' ) {
424424 // Nested array (e.g., matrix[][]) - keep same fieldName, increment dimension
425- const nestedArrayCode = generateArrayCode (
425+ const nestedArrayCode = renderArrayCode (
426426 elementType as ArrayStructure ,
427427 indent ,
428428 fieldName ,
@@ -436,7 +436,7 @@ function generateArrayCode(
436436 arrayInfo && ! Array . isArray ( arrayInfo ) && 'elements' in arrayInfo
437437 ? arrayInfo . elements
438438 : { } ; // Fallback to empty map for malformed array map
439- const objectCode = generateDocumentCode (
439+ const objectCode = renderDocumentCode (
440440 elementType as DocumentStructure ,
441441 indent ,
442442 nestedArrayLengthMap
0 commit comments