@botonic/react
Version:
Build Chatbots using React
10 lines (8 loc) • 321 B
text/typescript
import { BotonicAction, type BotonicActionType } from '@botonic/core'
export const getParsedAction = (botonicAction: BotonicActionType) => {
const splittedAction = botonicAction.split(`${BotonicAction.CreateCase}:`)
if (splittedAction.length <= 1) {
return undefined
}
return JSON.parse(splittedAction[1])
}