JavaScript (Node.js), 57 bytes
Expects an array of characters and returns a string.
s=>Buffer(s.flatMap(c=>c=="-"?a--:(a+=c=="+",[]),a=0))+""
Expects an array of characters and returns a string.
s=>Buffer(s.flatMap(c=>c=="-"?a--:(a+=c=="+",[]),a=0))+""