As beginner, I don't know what is I can start from. I need to implement function which will transform string to object with particular structure like I wrote below (original string may be with other number of levels, conditionals etc.):
const str = `time !== 10 && (state === 'Ready' || state === 'Pending')`;
const result = {
and: [
{
field: 'time',
expression: '!==',
value: 10
},
{
or: [
{
field: 'state',
expression: '===',
value: 'Ready'
},
{
field: 'state',
expression: '===',
value: 'Pending'
}
]
}
]
}