Here you check twice if `existing` if truthy (in the conditionnal, and in the `||` check).

I think I'd test `existing` is an array rather than checking if it is truthy. (That's not your fault though, it was like that before - reading the code, it feel safer to me, but checking truthy might be enough)