Xlab/fix/extra space (#2494)

* Fix extra space in `provider.send` signature from fabio. Fixes #2285.

* Fix style and update changelog.

Co-authored-by: Maxim <max@kc.vc>
This commit is contained in:
Jacob Evans 2020-02-25 19:56:33 +11:00 committed by GitHub
parent 8417fe4fdb
commit eb50f3fa9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,13 @@
[
{
"version": "5.4.1",
"changes": [
{
"note": "Fix extra space in `provider.send` signature",
"pr": 2428
}
]
},
{
"version": "5.4.0",
"changes": [

View File

@ -74,7 +74,7 @@ export const providerUtils = {
} else if ((supportedProvider as any).send !== undefined) {
// HACK(fabio): Detect if the `send` method has the old interface `send(payload, cb)` such
// as in versions < Web3.js@1.0.0-beta.37. If so, do a simple re-mapping
if (_.includes((supportedProvider as any).send.toString(), 'function (payload, callback)')) {
if (_.includes((supportedProvider as any).send.toString().replace(' ', ''), 'function(payload,callback)')) {
provider.sendAsync = (supportedProvider as any).send.bind(supportedProvider);
return provider;
} else {