Skip to content

Commit

Permalink
implementing letter sequentials
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpowell committed Dec 4, 2011
1 parent d031cad commit fc28d56
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions lib/tbd.js
Expand Up @@ -131,11 +131,23 @@
}; };


utils.sequential = function(start) { utils.sequential = function(start) {
return function () { if (start.constructor === Number) {
var x = start; return function () {
start++; var x = start;
return x; start++;
}; return x;
};
} else if (start.constructor === String) {
var letters = 'abcdefghijklmnopqrstuvwxyz'.split('');
start = letters.indexOf(start);
return function () {
var x = start;
start++;
return letters[x];
};
} else {
throw 'This type is not supported for sequential values at the moment';
}
}; };


this.tbd.utils = utils; this.tbd.utils = utils;
Expand Down

0 comments on commit fc28d56

Please sign in to comment.