This file contains hidden or 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
const next = function(number){ | |
if(number < 9 ){ | |
return number + 1; | |
} | |
const numberAsString = Number(number).toString(); | |
let numerics = numberAsString.split('').map(x => parseInt(x)); | |
let maxSize = numerics.length; | |
let firstDigit = numerics.length && (numerics[0] + 1) || null; | |
if(firstDigit && firstDigit > 9){ | |
firstDigit = 1; |
This file contains hidden or 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
/** | |
Code copyright Dustin Diaz and Ross Harmes, Pro JavaScript Design Patterns. | |
**/ | |
// Constructor. | |
var Interface = function (name, methods) { | |
if (arguments.length != 2) { | |
throw new Error("Interface constructor called with " + arguments.length + "arguments, but expected exactly 2."); | |
} | |
this.name = name; |
This file contains hidden or 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
rivets.formatters['!'] = function(value) | |
{ | |
return !value; | |
}; | |
rivets.formatters.eq = function(value, args) | |
{ | |
return value === args; | |
}; | |
rivets.formatters.neq = function(value, args) | |
{ |