44 camel ,
55 type ClientBuilder ,
66 type ClientGeneratorsBuilder ,
7- conventionName ,
87 type ContextSpec ,
8+ conventionName ,
99 escape ,
1010 generateMutator ,
1111 type GeneratorDependency ,
@@ -237,7 +237,7 @@ export const generateZodValidationSchemaDefinition = (
237237
238238 const CHAINABLE_SIBLINGS = new Set ( [ 'nullable' , 'default' , 'description' ] ) ;
239239 const isChainable = ( k : string ) => CHAINABLE_SIBLINGS . has ( k ) ;
240- const allSiblingsChainable = siblings . every ( isChainable ) ;
240+ const allSiblingsChainable = siblings . every ( ( k ) => isChainable ( k ) ) ;
241241
242242 if ( allSiblingsChainable ) {
243243 const refName = conventionName (
@@ -255,7 +255,7 @@ export const generateZodValidationSchemaDefinition = (
255255 default ?: unknown ;
256256 description ?: string ;
257257 } ;
258- const refRequired = rules ? .required ?? false ;
258+ const refRequired = rules . required ?? false ;
259259 const refHasDefault = refSchema . default !== undefined ;
260260
261261 // Match the main-path modifier ordering: nullability/optional first,
@@ -275,7 +275,7 @@ export const generateZodValidationSchemaDefinition = (
275275 // constNameRegistry-based suffix that the rest of the generator uses so
276276 // multiple defaults sharing `name` don't collide on `<name>Default`.
277277 if ( refHasDefault ) {
278- const registry = rules ? .constNameRegistry ?? { } ;
278+ const registry = rules . constNameRegistry ?? { } ;
279279 const counter = isNumber ( registry [ name ] ) ? registry [ name ] + 1 : 0 ;
280280 registry [ name ] = counter ;
281281 const suffix = counter ? pascal ( getNumberWord ( counter ) ) : '' ;
@@ -1790,7 +1790,7 @@ const generateZodRoute = async (
17901790 const isZodV4 =
17911791 ! ! context . output . packageJson && isZodVersionV4 ( context . output . packageJson ) ;
17921792 const useReusableSchemas =
1793- context . output . override . zod . generateReusableSchemas === true ;
1793+ context . output . override . zod . generateReusableSchemas ;
17941794 const spec = context . spec . paths ?. [ pathRoute ] ;
17951795
17961796 if ( spec == undefined ) {
@@ -1928,7 +1928,7 @@ const generateZodRoute = async (
19281928 } )
19291929 : undefined ;
19301930
1931- let inputResponses = parsedResponses . map ( ( parsedResponse ) =>
1931+ const inputResponses = parsedResponses . map ( ( parsedResponse ) =>
19321932 parseZodValidationSchemaDefinition (
19331933 parsedResponse . input ,
19341934 context ,
@@ -1941,7 +1941,7 @@ const generateZodRoute = async (
19411941
19421942 const SENTINEL_PATTERN = / _ _ R E F _ ( [ A - Z a - z _ $ ] [ A - Z a - z 0 - 9 _ $ ] * ) _ _ / g;
19431943 const rewriteSentinels = ( s : string ) : string =>
1944- s . replace ( SENTINEL_PATTERN , ( _m , name : string ) => name ) ;
1944+ s . replaceAll ( SENTINEL_PATTERN , ( _m , name : string ) => name ) ;
19451945
19461946 const allUsedRefs = new Set < string > ( [
19471947 ...inputParams . usedRefs ,
@@ -2070,7 +2070,7 @@ export const generateZod: ClientBuilder = async (verbOptions, options) => {
20702070 // Zod schemas are runtime values (not type-only), so mark with values: true
20712071 // to prevent the import writer from emitting `import type { ... }`. Sort
20722072 // by name so import order is stable across runs.
2073- imports : [ ...( usedRefs ?? [ ] ) ] . sort ( ) . map ( ( name ) => ( {
2073+ imports : [ ...usedRefs ] . toSorted ( ) . map ( ( name ) => ( {
20742074 name,
20752075 schemaName : name ,
20762076 values : true ,
0 commit comments