CurrencyCloud / currencycloud-js

MIT License
20 stars 26 forks source link

Calling any method with onBehalfOf mutates the original object passed in #53

Open mattpocock opened 4 years ago

mattpocock commented 4 years ago

Imagine a test file with the following:

const args = { id: 'account-id' }

await currencyCloud.onBehalfOf('contact-id', () => {
  return currencyCloud.accounts.get(args);
});

expect(args.onBehalfOf).toEqual('contact-id');

Ran into this during development, so forked currency-cloud to avoid it.

jonathancouchman commented 4 years ago

@mattpocock thanks for raising this. Feel free to link you forked repo so that we can see what you have done.