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

fix(generator): Output Parser.parseItem() calls with one valid type, without the array #551

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

absidue
Copy link
Collaborator

@absidue absidue commented Dec 2, 2023

When there is only one valid type being passed to Parser.parseItem or Parser.parse, it can be passed directly without being wrapped in an array, this pull request changes the generated output to only use an array when it is needed.

// before
this.abc = Parser.parseItem(data.abc, [ YTNodes.AbcView ])
this.abc2 = Parser.parseItem(data.abc2, [ YTNodes.AbcView, YTNodes.AbcdView ])

// afterwards
this.abc = Parser.parseItem(data.abc, YTNodes.AbcView)
this.abc2 = Parser.parseItem(data.abc2, [ YTNodes.AbcView, YTNodes.AbcdView ])

@LuanRT LuanRT merged commit bd487f8 into LuanRT:main Dec 4, 2023
4 checks passed
@absidue absidue deleted the generator-parse-one-item branch December 4, 2023 18:46
Wykerd added a commit that referenced this pull request Dec 11, 2023
Add Parser#parse overload to support non array validTypes.

Fixes issue in generator generating invalid Parser#parse calls
introduced in #551.
LuanRT pushed a commit that referenced this pull request Dec 21, 2023
* feat(generator): add support for arrays

* fix(parser): add overload for non array validTypes

Add Parser#parse overload to support non array validTypes.

Fixes issue in generator generating invalid Parser#parse calls
introduced in #551.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants