I updated the code to accept any negative value (as it is defined in the Readme), currently only -1 was hardcoded. And in addition to that, I changed the default values to Infinity - it is a number just like any other but always larger than any finite number.
ps. my code editor trimmed whitespace from the line endings, creating a bit cluttered diff. sorry for that.
Set default value to Infinity, fix negative value check
I'm curious, does this add any additional functionality?
No, it does not. It just allows you to pass any negative value as it is said on the documentation, not just -1
note: a negative value will indicate infinite memory/maxUptime
Setting default value to Infinity does not change the behavior in any way, it is a good value to use since it is always greater than any finite number and thus suits well for the task.
Cool. I usually don't use the Infinity keyword for anything. I'll run some JSperfs for fun and probably merge it in.