Isn't storing a JWT in a non-httponly cookie just as insecure as local storage?

I’m not familiar with cache.ts but it looks like an in-memory object/array that is simply storing objects. This is fast and great for a single HTML page but when navigating to a new page or new tab, won’t you lose this context?