Replies: 2 comments 1 reply
-
Yeah, I think C makes the most sense 👍🏻 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The return value of
structuredDiffForFile
is not well typed. (and I use this heavily)danger-js/source/danger.d.ts
Lines 809 to 813 in a7355a3
I did a little research and found that in general case, the
parse-diff
's return object is used as is. see. #1089The case of
BitBucketServer
is an exception and there seems to be some effort. see. #773danger-js/source/platforms/bitbucket_server/BitBucketServerGit.ts
Lines 77 to 80 in a7355a3
There is some variation of plan, as far as I can think:
A. Create
BitBucketServerGitDSL
or just likeGitDSL<BitBuckerServer>
, which have specialized type definition ofstructredDiffForFile
.B. Add type for general case. BitBucketServer users are required to cast type for their environment.
C. Add type for general case. Modify the implementation for BitBucketServer to fit the general case.
D. Add type as union of general case and specialized case. All user must choice to write type-narrowing code or to ignore types.
E. No change for code. Provide a comment to get well-typed
structuredDiffForFile
.F. other
According to #773 , C is the most likely choice but there's still a difference.
How do you think about this?
Beta Was this translation helpful? Give feedback.
All reactions