19 lines
501 B
TypeScript
Raw Normal View History

2025-04-10 10:03:19 +08:00
import type {
ValueSelector,
} from '../types'
import type {
BlockEnum,
} from '../types'
import { hasErrorHandleNode } from '.'
export const variableTransformer = (v: ValueSelector | string) => {
if (typeof v === 'string')
return v.replace(/^{{#|#}}$/g, '').split('.')
return `{{#${v.join('.')}#}}`
}
export const isExceptionVariable = (variable: string, nodeType?: BlockEnum) => {
2025-04-14 15:28:20 +08:00
return (variable === 'error_message' || variable === 'error_type') && hasErrorHandleNode(nodeType)
2025-04-10 10:03:19 +08:00
}