( path: string, workflows: WorkflowAliasWorkflow[] )
| 247 | } |
| 248 | |
| 249 | export function resolveWorkflowAliasPath( |
| 250 | path: string, |
| 251 | workflows: WorkflowAliasWorkflow[] |
| 252 | ): WorkflowAliasTarget | null { |
| 253 | const normalizedPath = path.trim().replace(/^\/+|\/+$/g, '') |
| 254 | if (!normalizedPath.startsWith('workflows/')) return null |
| 255 | |
| 256 | const bySpecificity = [...workflows].sort( |
| 257 | (a, b) => workflowVfsPath(b).length - workflowVfsPath(a).length |
| 258 | ) |
| 259 | for (const workflow of bySpecificity) { |
| 260 | const target = workflowAliasTargetForPath(workflow, normalizedPath) |
| 261 | if (target) return target |
| 262 | } |
| 263 | return null |
| 264 | } |
| 265 | |
| 266 | export function isWorkflowAliasPath(path: string): boolean { |
| 267 | const normalizedPath = path.trim().replace(/^\/+|\/+$/g, '') |
no test coverage detected