[ts] Fix empty source/dest namespaces when reexporting. (#5841)
[ts] Fix empty source/dest namespaces when reexporting. (#5841)

When either source or destination or both namespaces were empty, flatc
was generating incorrect TS code.

For example:

```
export namespace  {
export import ObjectId = NS10770172024577249292..ObjectId;}
```

In this case the target namespace is empty, and so is the namespace
between the NSxxx placeholder and the target type.
evolutional/flatbuffers,evolutional/flatbuffers,evolutional/flatbuffers,evolutional/flatbuffers,DavadDi/flatbuffers,pjulien/flatbuffers,pjulien/flatbuffers,evolutional/flatbuffers,alexames/flatbuffers,google/flatbuffers,alexames/flatbuffers,evolutional/flatbuffers,pjulien/flatbuffers,evolutional/flatbuffers,google/flatbuffers,evolutional/flatbuffers,pjulien/flatbuffers,DavadDi/flatbuffers,pjulien/flatbuffers,alexames/flatbuffers,google/flatbuffers,evolutional/flatbuffers,alexames/flatbuffers,google/flatbuffers,google/flatbuffers,evolutional/flatbuffers,google/flatbuffers,google/flatbuffers,pjulien/flatbuffers,DavadDi/flatbuffers,google/flatbuffers,DavadDi/flatbuffers,alexames/flatbuffers,pjulien/flatbuffers,google/flatbuffers,pjulien/flatbuffers,pjulien/flatbuffers,DavadDi/flatbuffers,pjulien/flatbuffers,alexames/flatbuffers,google/flatbuffers,evolutional/flatbuffers,google/flatbuffers,alexames/flatbuffers,evolutional/flatbuffers,DavadDi/flatbuffers,pjulien/flatbuffers,evolutional/flatbuffers,google/flatbuffers,google/flatbuffers,pjulien/flatbuffers,alexames/flatbuffers,alexames/flatbuffers,alexames/flatbuffers,google/flatbuffers,alexames/flatbuffers,alexames/flatbuffers,alexames/flatbuffers,alexames/flatbuffers,alexames/flatbuffers,google/flatbuffers