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

Make extra parameters optional for JS/TS backends #230

Merged
merged 1 commit into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion stone/backends/js_types.py
Expand Up @@ -220,7 +220,7 @@ def _generate_struct(self, struct_type, extra_parameters=None, nameOverride=None
for param_name, param_type, param_docstring in extra_parameters:
param_docstring = ' - %s' % param_docstring if param_docstring else ''
self.emit_wrapped_text(
'@property {%s} %s%s' % (
'@property {%s} [%s]%s' % (
param_type,
param_name,
param_docstring,
Expand Down
3 changes: 2 additions & 1 deletion stone/backends/tsd_types.py
Expand Up @@ -379,7 +379,8 @@ def _generate_struct_type(self, struct_type, indent_spaces, extra_parameters):
for param_name, param_type, param_docstring in extra_parameters:
if param_docstring:
self._emit_tsdoc_header(param_docstring)
self.emit('%s: %s;' % (param_name, param_type))
# Making all extra args optional parameters
self.emit('%s?: %s;' % (param_name, param_type))

for field in struct_type.fields:
doc = field.doc
Expand Down