2
0

👷 Transpile components for better DX

This commit is contained in:
Baptiste Arnaud
2022-09-18 09:46:42 +02:00
committed by Baptiste Arnaud
parent 898367a33b
commit c1dd4d403e
147 changed files with 343 additions and 485 deletions

View 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,
}
}