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
[pcl/nodejs] Support range expressions that are of type output #12749
Conversation
Changelog[uncommitted] (2023-04-26)Features
|
@@ -177,7 +177,7 @@ func (g *generator) GenForExpression(w io.Writer, expr *model.ForExpression) { | |||
|
|||
if expr.Key != nil { | |||
// TODO(pdg): grouping | |||
g.Fgenf(w, ".reduce((__obj, %s) => { ...__obj, [%.v]: %.v })", reduceParams, expr.Key, expr.Value) | |||
g.Fgenf(w, ".reduce((__obj, %s) => ({ ...__obj, [%.v]: %.v }))", reduceParams, expr.Key, expr.Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small fix for this expression where it was missing the extra parenthesis around the returned object, otherwise it is invalid TypeScript
d2a261a
to
1ebf015
Compare
8d39416
to
e9c9fb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look reasonable
bors merge |
Build succeeded:
|
Description
This PR implements nodejs program-gen support for
range
expressions that are of typeOutput<T>
whereT
is a collection that should be iterated inside anapply
call.Example PCL
Generated TypeScript
Checklist
make changelog
and committed thechangelog/pending/<file>
documenting my change