Skip to content

Commit

Permalink
Merge pull request #57 from sunwrobert/patch-1
Browse files Browse the repository at this point in the history
Fix detection for `provider.send(payload,cb)` to use replaceAll inste…
  • Loading branch information
moodlezoup authored Jan 19, 2022
2 parents a961463 + 50745b3 commit bdac384
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 < [email protected]. 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 bdac384

Please sign in to comment.