Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Don't add undefined type to optional arguments #4

Closed
urish opened this issue Jan 14, 2018 · 0 comments
Closed

Don't add undefined type to optional arguments #4

urish opened this issue Jan 14, 2018 · 0 comments

Comments

@urish
Copy link
Collaborator

urish commented Jan 14, 2018

For instance, give the following input:

function optional(b?) {
  return b || 0;
}

console.log(optional() + optional(10));

typewiz would generate: function optional(b?: number|undefined) {
while a valid code, the undefined type can be omitted, retaining the same semantics.

@urish urish changed the title Don't add undefined as type for optional params Don't add undefined type to optional arguments Jan 14, 2018
@urish urish closed this as completed in 0540b33 Jan 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant