( node: FormKitNode, target: number | string )
| 390 | } |
| 391 | |
| 392 | function getTargetStep( |
| 393 | node: FormKitNode, |
| 394 | target: number | string |
| 395 | ): FormKitFrameworkContext | undefined { |
| 396 | const steps = node.props.steps as FormKitFrameworkContext[] | undefined |
| 397 | if (!Array.isArray(steps)) return |
| 398 | if (typeof target === 'number') { |
| 399 | return steps[target] |
| 400 | } else if (typeof target === 'string') { |
| 401 | return steps.find( |
| 402 | (step: Record<string, any>) => step.node.name === target |
| 403 | ) |
| 404 | } |
| 405 | return undefined |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * Changes the current step by the delta value if the target step is allowed. |
no outgoing calls
no test coverage detected