-
Notifications
You must be signed in to change notification settings - Fork 0
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
MF info properties untyped #226
Comments
They are untyped because there is an option to override the property name to which the result is assigned. mass-tools/packages/mf-parser/src/util/getInfo.js Lines 27 to 28 in f663e61
It is used by octochem. https://github.com/search?q=org%3Acheminfo%20emFieldName&type=code @lpatiny do you know the reason for this? |
There is some history behind it and the fact that on one end I wanted to use 'short' properties names (em and mz) and on the other one a property name that means something (monoisotopicMass and observedMonoisotopicMass). I think it will be time to make some big refactoring and breaking changes and only keep monoisotopicMass and observedMonoisotopicMass but I need to find the time to do it (a lot of implications). |
In the mean time, what should we do? Make the return type dynamically depend on these options? |
I can try to do that, but I'm not very used to be defining types in jsdoc. I don't even know if it's possible. |
You can mix ts and js files in this project, and import from ts in the js doc if it easier for you |
Could you just use the library with defining the type in your project for a while ? Because I would really prefer we make breaking changes rather than making complex types. Same is true when fwhm = 0. We ned another function in this case so that the return type is constant. You can open issues with all the inconsistencies in this library. |
We can ignore the type problem (it is what we do right now). But if we fix it, it's the same amount of work to fix it in the library so we'd better do that. If done with good type inference it would not force user to do something more complex at the typescript level when using the |
Closed by #241 (partial migration to typescript with advanced types) |
The 2 properties
monoisotopicMass
andobservedMonoisotopicMass
can exist on thePartInfo
object but are not typed.The text was updated successfully, but these errors were encountered: