-
Notifications
You must be signed in to change notification settings - Fork 0
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
modified loop and conditional code #23
Conversation
src/utils/code.ts
Outdated
propsNames: string[], | ||
childComponent: IComponent, | ||
) => { | ||
) => any = (propsNames: string[], childComponent: IComponent) => { |
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.
why any?
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.
its possible the type is a string, I'll change it to boolean | string
src/utils/code.ts
Outdated
childComponent, | ||
)}? <>${buildSingleBlock({ | ||
content += `{${ | ||
returnConditionalValue(propsNames, childComponent) === true || |
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.
why not typeof?
src/utils/code.ts
Outdated
)}? <>${buildSingleBlock({ | ||
content += `{${ | ||
returnConditionalValue(propsNames, childComponent) === true || | ||
returnConditionalValue(propsNames, childComponent) === false |
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.
Extract the value in variable first. See if you can improve the code, its not readable
src/utils/code.ts
Outdated
childComponent, | ||
)}})[0].map((item${childComponent.id.slice( | ||
content += `{${ | ||
typeof returnLoopValue(propsNames, childComponent) === 'object' |
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.
same comments as above
src/utils/code.ts
Outdated
childComponent, | ||
)}? <>${buildSingleBlock({ | ||
content += `{${ | ||
returnConditionalValue(propsNames, childComponent) === true || |
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.
same as above
src/utils/code.ts
Outdated
childComponent, | ||
)}].map((item${childComponent.id.slice( | ||
content += `{${ | ||
typeof returnLoopValue(propsNames, childComponent) === 'object' |
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.
same as above. Try to refactor duplicates
No description provided.