@rauschma agree! I really enjoy TS structural typing, and I think it has more potential than nominal typing for projects with many third-party packages and future distributed and decentralized applications.
One rule I've learned is to avoid mutable types if you want fewer cases when TypeScript can't catch bugs.
@shivelysanders should know better how to resolve such issues:
https://github.com/sergey-shandar/public/blob/45a6cb1f8cd21d284c84dae5ce50a8c6afd04397/index.mjs