Skip to content

Commit

Permalink
string/number
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoefe committed Oct 4, 2016
1 parent 52b034b commit 20bf7d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/discrepances.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ discrepances = function discrepances(a, b){
if(typeA === 'number') {
return {difference:a-b, values:[a,b]};
}
} else {
return {types:[typeA,typeB], values:[a,b]}
}
// var rta='';
// if(def && def.typeof && typeof obj !== def.typeof){
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("discrepances", function(){
[
{a:4 , b:4 , expected: null },
{a:4 , b:5 , expected: {difference:-1 , values:[4, 5] }},
{skip:true, a:"4" , b:4 , expected: {types:['string', 'number'], values:["4", 4] }},
{a:"4" , b:4 , expected: {types:['string', 'number'], values:["4", 4] }},
{skip:true, a:null , b:0 , expected: {types:['null' , 'number'], values:[null, 0] }},
{skip:true, a:new Date() , b:/a/ , expected: {class:['Date' , 'RegExp'], values:[new Date(), /a/] }},
{skip:true, a:new Date(2011,1,3), b:new Date(2011,1,4) , expected: {difference:'a definir', values:[new Date(2011,1,3), new Date(2011,1,4)] }},
Expand Down

0 comments on commit 20bf7d8

Please sign in to comment.