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

[usability] quoteNone type in quote makes coding a pain #417

Closed
gadicc opened this issue Feb 26, 2022 · 5 comments
Closed

[usability] quoteNone type in quote makes coding a pain #417

gadicc opened this issue Feb 26, 2022 · 5 comments
Labels
bug Something isn't working released

Comments

@gadicc
Copy link
Owner

gadicc commented Feb 26, 2022

As reported by @dtslvr in #416:

I have upgraded to [email protected] and have the following type error: Property 'currency' does not exist on type 'QuoteNone' for this snippet:

const quotes = await yahooFinance2.quote(['TSLA']);

for (const quote of quotes) {
  console.log('currency', quote.currency);
}

How can I deal with QuoteNone?

@gadicc gadicc added the bug Something isn't working label Feb 26, 2022
@gadicc
Copy link
Owner Author

gadicc commented Feb 26, 2022

As I stated there, in the meantime you workaround this like:

  if (quote.quoteType !== "NONE")
    console.log('currency', quote.currency);

but that's a pain and we can do better.

@gadicc gadicc closed this as completed in 5178c78 Feb 26, 2022
gadicc pushed a commit that referenced this issue Feb 26, 2022
## [2.1.8](v2.1.7...v2.1.8) (2022-02-26)

### Bug Fixes

* **quote:** don't pulle Quote with QuoteNone (fixes [#417](#417)) ([5178c78](5178c78))
@gadicc
Copy link
Owner Author

gadicc commented Feb 26, 2022

🎉 This issue has been resolved in version 2.1.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gadicc
Copy link
Owner Author

gadicc commented Feb 26, 2022

Big thanks to @dtslvr who noticed this so soon and reported straight away 🙌🎉

@dtslvr
Copy link
Collaborator

dtslvr commented Feb 26, 2022

Big thanks to @dtslvr who noticed this so soon and reported straight away 🙌🎉

Thanks a lot for providing a solution that quick! 🤩

@gadicc
Copy link
Owner Author

gadicc commented Feb 27, 2022

Sure... the quoteNone thing was just in the last release so if when we unintentionally make the developer experience worse with a release we try fix it up as quick as we can :) So early reports like yours really help 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants