-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
enable typescript strict mode #3010
Changes from all commits
c10d89e
58e1f25
0099821
869a6df
2bac22d
a400227
072e9ec
ed58bc8
71f40c7
d1bd5f8
63dc88c
c54e8d0
fb67464
acc6263
d8bdfef
40426ef
01145bd
673d62d
e6f88cb
61a2c22
62c3ae9
bef41e4
e1afdb0
18091cc
604dcf7
3f00108
451df99
225dc5c
7fd2468
b8d392b
f09afd1
78b7d53
ab7dff5
c2b86c8
48da64a
25bb0de
b870c88
2af1ba3
04d4ff4
4106e68
e6c9433
51f13f6
13edfdd
8bd511e
d00ada6
81ffd42
39be50c
8249e56
9b42a69
e6fd004
78f7012
4e6c9ae
1394099
5800b78
3a6a64b
453ceb3
29ea0a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,11 @@ interface Transformation { | |
context: Record<string, any>; | ||
} | ||
|
||
export class Transformer { | ||
export class Transformer<TContext = Record<string, any>> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any benefit in passing the TContext along with the Transforms or does it make more sense to just use any for all the type signatures that complain that TContext might be wrong (e.g. in the constructor)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess yes as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think those who write transforms involving the context need that to be typed correctly and passed correctly to their transforms. I am not 100% on how our use of any will affect those users. :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could release an alpha and ask for feedback? But, this would slow down the process of actually releasing this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But since it is just a default value and everyone could overwrite it if desired I guess it is fine to leave it like that. |
||
private transformations: Array<Transformation> = []; | ||
private delegationContext: DelegationContext; | ||
private delegationContext: DelegationContext<any>; | ||
|
||
constructor(context: DelegationContext, binding: DelegationBinding = defaultDelegationBinding) { | ||
constructor(context: DelegationContext<TContext>, binding: DelegationBinding<TContext> = defaultDelegationBinding) { | ||
this.delegationContext = context; | ||
const delegationTransforms: Array<Transform> = binding(this.delegationContext); | ||
delegationTransforms.forEach(transform => this.addTransform(transform, {})); | ||
|
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.
The
relocatedError
shim removes the batched index when merging errors into results, and callers should receive the same behavior as if they had not batched.If there is no path,
relocatedError(originalError, undefined)
should cause the error to be copied, but it is unnecessary, and we could just return theoriginalError
. For correctness, we could/should also check to make sure that the first element of the path is thefieldName
and the second is a number, because some servers do not properly path errors.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.
Please let me know whether bef2164 is what you had in mind