You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using overloaded signatures makes it clear when the inputEncoding is required, and when the return value will be a string vs. buffer. The correct signatures would be something like:
The call to update suggests that a second param can be passed, but this isn't true for buffers. And the type of hash above is ambiguously string | Buffer, when it is guaranteed to be string since an encoding was provided.
The text was updated successfully, but these errors were encountered:
System Info
macOS
Details
The
Hash
class' digest and update methods are incorrect. They are ambiguous and should use overloads like the node type declarations do.The existing signatures are:
rspack/packages/rspack/src/util/hash/index.ts
Lines 21 to 23 in 2d10e9a
rspack/packages/rspack/src/util/hash/index.ts
Lines 32 to 34 in 2d10e9a
Using overloaded signatures makes it clear when the
inputEncoding
is required, and when the return value will be a string vs. buffer. The correct signatures would be something like:Reproduce link
No response
Reproduce Steps
In a loader, do something like:
The call to update suggests that a second param can be passed, but this isn't true for buffers. And the type of
hash
above is ambiguouslystring | Buffer
, when it is guaranteed to bestring
since an encoding was provided.The text was updated successfully, but these errors were encountered: