pamelafox/lscache — pull request #12 by mckamey (2012-01-17 20:22:52+00:00)
Title: Implemented your TODO item

I implemented a change to your catch block in `set`. It now tracks how much space is being freed and stops once enough has been freed that the new item should fit.

I also reflowed your `get` method so that it doesn't require an inner function and doesn't call `getItem` multiple times for the same values.

Also I parameterized two values:

- the expiration unit size so that by changing the constant it can be something other than minutes
- the base of the expiration value so that doesn't need to be base-10. e.g., base-36 is a couple digits more compact per each entry

And finally I made some very minor tweaks so that it passes [JSHint](http://jshint.com) checking. I tried to stay respectful of your code style.

All original unit tests pass but I didn't add any additional.