ScottHamper / Cookies

JavaScript Client-Side Cookie Manipulation Library
The Unlicense
1.77k stars 169 forks source link

minor refactor _getExtendedOptions and _getExpiresDate #56

Closed Xuefeng-Zhu closed 8 years ago

ScottHamper commented 8 years ago

Hey @Xuefeng-Zhu ,

The _getExetendedOptions refactor is definitely a reasonable change, but the _getExpiresDate refactor causes a unit test to fail. Having now as a function argument allows for dependency injection of the current Date, which is necessary for automated testing. It is admittedly not ideal to have code which sole purpose is to cater to unit testing, but I'd rather that then not be able to test the function entirely.

In any case, at some point I may get around to a complete refactoring of the library in TypeScript/ES6. It's been on my mind. Until then, I'm only really interested in fixing any bugs that crop up.

Regardless, thank you for checking out the library!