Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. + Fixes GH-12 * patch-12: Fixing indentation Adding flush to readme adding method to flush all lscache items without affecting rest of localStorage removing my qunit to resolve conflict clear localStorage in setup/teardown Fixing a couple typos and removing dead code block adding missing qunit clear localStorage before tests minor tweaks removing items until item to be inserted fits reflow get for less repetition parameterize for tuning jshint.com recommendations
- Loading branch information
Showing
3 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters