👷 Transpile components for better DX
This commit is contained in:
committed by
Baptiste Arnaud
parent
898367a33b
commit
c1dd4d403e
15
packages/utils/typebotConversions.ts
Normal file
15
packages/utils/typebotConversions.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Typebot } from 'models'
|
||||
|
||||
export const convertTypebotToV2 = (typebot: any): Typebot => {
|
||||
const newTypebot = JSON.parse(
|
||||
JSON.stringify(typebot)
|
||||
.replace(/\"blocks\":/g, '"groups":')
|
||||
.replace(/\"steps\":/g, '"blocks":')
|
||||
.replace(/\"blockId\":/g, '"groupId":')
|
||||
.replace(/\"blockId\":/g, '"blockId":')
|
||||
)
|
||||
return {
|
||||
version: '2',
|
||||
...newTypebot,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user