File tree Expand file tree Collapse file tree
plugins/@hey-api/transformers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @hey-api/openapi-ts " : patch
3+ ---
4+
5+ ** plugin(@hey-api/transformers )** : fix: use symbols for ` additionalProperties ` key variables
Original file line number Diff line number Diff line change @@ -195,16 +195,17 @@ function processSchemaType({
195195 }
196196
197197 if ( schema . additionalProperties && dataExpression ) {
198+ const key = plugin . symbol ( 'key' ) ;
198199 const entryValueNodes = processSchemaType ( {
199- dataExpression : $ ( dataExpression ) . attr ( ' key' ) . computed ( ) ,
200+ dataExpression : $ ( dataExpression ) . attr ( key ) . computed ( ) ,
200201 plugin,
201202 schema : schema . additionalProperties ,
202203 } ) ;
203204
204205 if ( entryValueNodes . length ) {
205206 const properties = Object . keys ( schema . properties ?? { } ) ;
206207 nodes . push (
207- $ . for ( $ . const ( ' key' ) )
208+ $ . for ( $ . const ( key ) )
208209 . of ( $ ( 'Object' ) . attr ( 'keys' ) . call ( dataExpression ) )
209210 . $if (
210211 properties . length ,
@@ -214,7 +215,7 @@ function processSchemaType({
214215 $ . not (
215216 $ . array ( ...properties )
216217 . attr ( 'includes' )
217- . call ( ' key' ) ,
218+ . call ( key ) ,
218219 ) ,
219220 ) . do ( ...entryValueNodes ) ,
220221 ) ,
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ class ImplForTsDsl<M extends ForMode = 'for'> extends Mixed {
4242 override analyze ( ctx : AnalysisContext ) : void {
4343 ctx . analyze ( this . _condition ) ;
4444 ctx . analyze ( this . _iterableOrUpdate ) ;
45- ctx . analyze ( this . _variableOrInit ) ;
4645 ctx . pushScope ( ) ;
46+ ctx . analyze ( this . _variableOrInit ) ;
4747 try {
4848 super . analyze ( ctx ) ;
4949 } finally {
You can’t perform that action at this time.
0 commit comments