1
1
import isDevelopment from '#is-development' ;
2
- import { STATE_DELIMITER } from './constants.ts' ;
3
2
import { $$ACTOR_TYPE } from './interpreter.ts' ;
4
3
import { memo } from './memo.ts' ;
5
4
import { MachineSnapshot } from './StateMachine.ts' ;
@@ -172,7 +171,6 @@ export class State<
172
171
this . context = config . context ;
173
172
this . historyValue = config . historyValue || { } ;
174
173
this . matches = this . matches . bind ( this ) ;
175
- this . toStrings = this . toStrings . bind ( this ) ;
176
174
this . configuration =
177
175
config . configuration ??
178
176
Array . from ( getConfiguration ( getStateNodes ( machine . root , config . value ) ) ) ;
@@ -185,24 +183,6 @@ export class State<
185
183
( this as any ) . error = config . error ;
186
184
}
187
185
188
- /**
189
- * Returns an array of all the string leaf state node paths.
190
- * @param stateValue
191
- * @param delimiter The character(s) that separate each subpath in the string state node path.
192
- */
193
- public toStrings ( stateValue : StateValue = this . value ) : string [ ] {
194
- if ( typeof stateValue === 'string' ) {
195
- return [ stateValue ] ;
196
- }
197
- const valueKeys = Object . keys ( stateValue ) ;
198
-
199
- return valueKeys . concat (
200
- ...valueKeys . map ( ( key ) =>
201
- this . toStrings ( stateValue [ key ] ) . map ( ( s ) => key + STATE_DELIMITER + s )
202
- )
203
- ) ;
204
- }
205
-
206
186
public toJSON ( ) {
207
187
const { configuration, tags, machine, ...jsonValues } = this ;
208
188
0 commit comments