Function for formatting an array
const formate = array =&gt; array.map(({all, any, not}) =&gt; ({all: all.split(","), any: any.split(","), not: not.split(",")}));


With empty arrays:

const formate = array =&gt; array.map(({all, any, not}) =&gt; ({all: all?all.split(","):[], any: any?any.split(","):[], not: not?not.split(","):[]}));