Skip to content

Commit

Permalink
Properly handle falsy maxItems
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd committed Sep 8, 2016
1 parent 8bd298a commit 0dbc8e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spique.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module.exports = Spique;
function Spique(maxItems, circumference) {
var defaultCircumference = 1000;
circumference = circumference ? parseInt(circumference) : defaultCircumference;
if(!maxItems || !(typeof maxItems === 'number'))
maxItems = Math.floor(Number.MAX_VALUE);

var firstRing = new RingBuffer(circumference);
var lastRing = firstRing;
Expand Down

0 comments on commit 0dbc8e1

Please sign in to comment.