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

Functions have inappropriate type for optional parameters in TypeScript declaration #44

Closed
Sardtok opened this issue Apr 10, 2019 · 4 comments

Comments

@Sardtok
Copy link

Sardtok commented Apr 10, 2019

Basics
TypeScript declarations do not allow not leaving out optional parameters.

Describe the bug
In the TypeScript declarations optional parameters do not have types with ?, making them required parameters. Examples include toArray(initial: any[]): any[];, where initial is described as an optional argument. However, this should be toArray(initial?: any[]): any[];. This also goes for DataStream.map functions, which take an optional sub-class constructor.

To Reproduce
Attempt using the functions without supplying optional parameters in TypeScript. This should produce errors during transpilation.

Expected behavior
Use functions without supplying optional parameters. Compilation should not produce errors.

Test case
If possible, please provide an automated test case to include, better yet in a forked scramjet repo in test/cases.

Screenshots
Not applicable

System:

  • Any OS
  • TypeScript 3.4.1

Additional context
Not applicable

@MichalCz
Copy link
Member

Hey, thanks for reporting this... I'll take a look and report back on my findings...

@MichalCz MichalCz modified the milestones: v4.24, v4.23 Apr 10, 2019
@MichalCz
Copy link
Member

Seems like an easy fix - the jsdoc is not correct there. Since that's a API change (slight as it is) it will be a new minor, not a patch.

Release ETA tomorrow.

@MichalCz
Copy link
Member

Hi @Sardtok can you check version v4.23 and report back on the issue?

@Sardtok
Copy link
Author

Sardtok commented Apr 11, 2019

We've updated the dependencies, and it works perfectly.
Thanks for the super quick response!

@Sardtok Sardtok closed this as completed Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants