-
Notifications
You must be signed in to change notification settings - Fork 630
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
refactor(http): improve eTag()
return type for string
and Uint8Array
inputs
#5571
refactor(http): improve eTag()
return type for string
and Uint8Array
inputs
#5571
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5571 +/- ##
==========================================
- Coverage 96.49% 96.11% -0.38%
==========================================
Files 465 465
Lines 37772 37766 -6
Branches 5580 5549 -31
==========================================
- Hits 36447 36300 -147
- Misses 1283 1424 +141
Partials 42 42 ☔ View full report in Codecov by Sentry. |
http/etag_test.ts
Outdated
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.
Good to see @std/testing/types
being used to test overload signatures. We should probably do this more throughout the codebase.
http/etag.ts
Outdated
* Calculate an ETag for an entity. When the entity is a specific set of data | ||
* it will be fingerprinted as a "strong" tag, otherwise if it is just file | ||
* information, it will be calculated as a weak tag. |
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.
We should update the descriptions to orient themselves to their respective overloads.
I'd also change the title to something like "Improve overloads for |
eTag
return type for string
and Uint8Array
inputs
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.
LGTM once these last nits are addressed.
http/etag.ts
Outdated
* Calculate an ETag for an entity. When the entity is a specific set of data | ||
* it will be fingerprinted as a "strong" tag, otherwise if it is just file | ||
* information, it will be calculated as a weak tag. | ||
* Calculate an ETag for string or Uint8Array entities. This returns a strong tag. |
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.
Can you please clarify what you mean by "strong tag"?
eTag
return type for string
and Uint8Array
inputseTag
return type for string
and Uint8Array
inputs
eTag
return type for string
and Uint8Array
inputseTag()
return type for string
and Uint8Array
inputs
Not completely sure this is a breaking change, but this PR improves the return type of
eTag
function. Now it returnsPromise<string>
if the input isstring
orUint8Array
.related #5217