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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding support for intersection of arrays and tuples #1237
Conversation
return this.childTypeFormatter.getDefinition(types[0]); | ||
} | ||
|
||
const requirements: Definition[] = []; |
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.
Dependencies may be a better word.
|
||
types.forEach((t) => { | ||
if (t instanceof ArrayType || t instanceof TupleType) { | ||
/** |
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.
Use // comments in code
const dependencies: Definition[] = []; | ||
const nonArrayLikeTypes: BaseType[] = []; | ||
|
||
types.forEach((t) => { |
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.
use for ... instead of forEach
}); | ||
|
||
if (nonArrayLikeTypes.length) { | ||
/** |
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
if (t instanceof ArrayType || t instanceof TupleType) { | ||
/** | ||
* Arrays are not easily mergeable | ||
* So it's just easier to append their defs |
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.
I would add these comments higher up and focus more on the why than the what.
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.
I'm not sure I quite understand what you mean by the "why vs what". I will be moving the comments higher up in the in chain for now though.
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.
Comments should explain why we are doing something and now what is happening in the code.
f6112e9
to
2c2e655
Compare
馃殌 PR was released in |
Adding support for intersection of arrays and tupples such as:
Types originally from here.
Version
Published prerelease version:
v1.1.0-next.3
Changelog
馃帀 This release contains work from new contributors! 馃帀
Thanks for all your work!
鉂わ笍 null@filipomar
鉂わ笍 Remi Cattiau (@loopingz)
鉂わ笍 Hadrien Milano (@hmil)
馃殌 Enhancement
馃悰 Bug Fix
@description
#1177 (@Jason3S)馃敥 Dependency Updates
Authors: 8