@@ -35,7 +35,7 @@ export function createMermaidDiagram(
3535
3636 // initial transitions
3737 sm . initialTransitions . forEach ( transition => {
38- const label = getInitialTransitionLabel ( transition . postCond , showConditions ) ;
38+ const label = getInitialTransitionLabel ( transition . toCondition , showConditions ) ;
3939 lines . push ( ` [*] --> ${ transition . to } ${ label ? ` : ${ label } ` : '' } ` ) ;
4040 } ) ;
4141
@@ -45,8 +45,8 @@ export function createMermaidDiagram(
4545 const isCalledMethod = transition . label === sm . errorContext ?. calledMethod ;
4646 const label = getTransitionLabel (
4747 transition . label ,
48- transition . preCond ,
49- transition . postCond ,
48+ transition . fromCondition ,
49+ transition . toCondition ,
5050 showConditions ,
5151 isCalledMethod ,
5252 ) ;
@@ -72,8 +72,8 @@ export function createMermaidDiagram(
7272
7373function getTransitionLabel (
7474 label : string ,
75- preCond ?: string | null ,
76- postCond ?: string | null ,
75+ fromCondition ?: string | null ,
76+ toCondition ?: string | null ,
7777 showConditions = false ,
7878 isCalledMethod = false ,
7979) : string {
@@ -83,14 +83,14 @@ function getTransitionLabel(
8383 : escapedLabel ;
8484 if ( ! showConditions ) return methodLabel ;
8585 return [
86- getConditionLabel ( 'pre' , preCond ) ,
86+ getConditionLabel ( 'pre' , fromCondition ) ,
8787 methodLabel ,
88- getConditionLabel ( 'post' , postCond )
88+ getConditionLabel ( 'post' , toCondition )
8989 ] . filter ( Boolean ) . join ( '<br/>' ) ;
9090}
9191
92- function getInitialTransitionLabel ( postCond ?: string | null , showConditions = false ) : string {
93- return showConditions ? getConditionLabel ( 'post' , postCond ) : '' ;
92+ function getInitialTransitionLabel ( toCondition ?: string | null , showConditions = false ) : string {
93+ return showConditions ? getConditionLabel ( 'post' , toCondition ) : '' ;
9494}
9595
9696function getConditionLabel ( kind : 'pre' | 'post' , cond ?: string | null ) : string {
0 commit comments