Comparing version 0.1.0 to 0.1.1
21
index.js
@@ -26,11 +26,12 @@ /* | ||
}; | ||
var direction = !(from>to); | ||
while ((direction?to>=from:to<=from)) { | ||
if (lcase == undefined) { | ||
str = from; | ||
} else { | ||
str = RangeGen.enc(from,lcase); | ||
}; | ||
range.push(str); | ||
from += (direction?step:-step); | ||
var from = Number(from), | ||
to = Number(to), | ||
direction = !(from>to), | ||
incr = (direction?step:-step), | ||
start = (direction?from:to), | ||
end = (direction?to:from), | ||
loops = ~~((end-start)/step+2); | ||
while (--loops) { | ||
range.push((lcase==undefined?from:RangeGen.enc(from,lcase))); | ||
from += incr; | ||
}; | ||
@@ -49,3 +50,3 @@ return range; | ||
var num = 0; | ||
for (var i = 0; i != str.length; ++i) { | ||
for (var i = 0, l = str.length; i != l; ++i) { | ||
num = num*26+(str.charCodeAt(i)|0x20)-96; | ||
@@ -52,0 +53,0 @@ }; |
{ | ||
"name": "rangegen", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/LouisT/RangeGen", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -1,2 +0,2 @@ | ||
RangeGen (v0.1) | ||
RangeGen (v0.1.1) | ||
====== | ||
@@ -3,0 +3,0 @@ |
8436
112