cronofy / cronofy-node

Node wrapper for the Cronofy API
https://docs.cronofy.com/developers
MIT License
49 stars 23 forks source link

Clone arguments before adding default properties #68

Closed fastfedora closed 4 years ago

fastfedora commented 4 years ago

Prevents the client library from modifying the options argument during function calls, to allow the options object to be reused on future function calls. Uses a clone of the options instead to enhance with any additional properties that the internal code needs.

Note this uses a simplified version of clone with only the features required for this fix to minimize the size of the library.

Fixes #67

tomhazledine commented 4 years ago

Thanks for the detailed issue and fix, @fastfedora. Much appreciated 👍