Skip to content

Commit

Permalink
Fix detection for provider.send(payload,cb) to use replaceAll inste…
Browse files Browse the repository at this point in the history
…ad of replace
  • Loading branch information
sunwrobert authored Jan 18, 2022
1 parent 8be1949 commit 50745b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/src/provider_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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().replace(' ', ''), 'function(payload,callback)')) {
if (_.includes((supportedProvider as any).send.toString().replaceAll(' ', ''), 'function(payload,callback)')) {
provider.sendAsync = (supportedProvider as any).send.bind(supportedProvider);
return provider;
} else {
Expand Down

0 comments on commit 50745b3

Please sign in to comment.