Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeScript] Mistakes Map.get() to potentially return undefined #4

Open
beefchimi opened this issue Jan 16, 2022 · 0 comments
Open
Labels
🐛 Bug Something isn't working

Comments

@beefchimi
Copy link
Owner

Within socialite.ts, we have the following code:

const targetNetwork = id && this.hasNetwork(id) ? this._networks.get(id) : this.getNetworkFromDomain(matches.domain);

TypeScript seems to think its possible for this._networks.get(id) to return undefined, even though it is qualified by id && this.hasNetwork(id). Ideally, we have a way of asserting that the network exists when that condition is reached.

@beefchimi beefchimi added the 🐛 Bug Something isn't working label Jan 16, 2022
@beefchimi beefchimi changed the title [TypeScript] Mistakes Map.get() to potentially return undefined [TypeScript] Mistakes Map.get() to potentially return undefined Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant