JSFiddle - React, Tailwind, and code Playground
JavaScript
const aUniqueStringNotFoundInData = '___UNIQUE_____';
let x = 'a|b\\|c'.replace('\\\|', aUniqueStringNotFoundInData).split('\|');
x = x.reduce((acc, val) => {
val = val.replace(aUniqueStringNotFoundInData, '\\\|');
return acc.concat(val);
},[])
console.log(x);