-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: Exporting values. (#396) #398
Conversation
Added defined values to the exported JSON object.
feat: Exporting values. (tivac#396)
file.exports = message(result, "classes"); | ||
file.exports = Object.assign( | ||
Object.create(null), | ||
mapValues(file.values, (obj) => [ obj.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.
Since @value
statements don't have a composition graph to follow I don't think wrapping them in an array is worth it. This can probably mix in file.values
directly instead.
Side benefit is that classes & @value
s are easily differentiated just by glancing at them.
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.
Whoops, ignore that. Forgot that the output method expects everything to be an array so it can .join
them. This still feels a bit weird, but it's easier to go w/ the flow on it than to add special logic elsewhere.
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.
Yeah, I played with changing the join function to check if it is an array. But it made more sense just to wrap the value in an array.
Good sleuthing! I forgot about the |
Would you run |
Ran `npm test -- -u`
🎉 |
This is published as |
Added defined values to the exported JSON object. As discussed in #396