Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

variable.ts 501B

123456789101112131415161718
  1. import type {
  2. ValueSelector,
  3. } from '../types'
  4. import type {
  5. BlockEnum,
  6. } from '../types'
  7. import { hasErrorHandleNode } from '.'
  8. export const variableTransformer = (v: ValueSelector | string) => {
  9. if (typeof v === 'string')
  10. return v.replace(/^{{#|#}}$/g, '').split('.')
  11. return `{{#${v.join('.')}#}}`
  12. }
  13. export const isExceptionVariable = (variable: string, nodeType?: BlockEnum) => {
  14. return (variable === 'error_message' || variable === 'error_type') && hasErrorHandleNode(nodeType)
  15. }