react-native-math-expressions-mb
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -6,17 +6,17 @@ function addNumbers(...arg) { | ||
} | ||
let onlyInt = params.filter((value, index) => { | ||
let nonIntegers = params.filter((value, index) => { | ||
return /^\d+$/.test(value); | ||
}); | ||
if (onlyInt.length === 0) { | ||
if (nonIntegers.length === 0) { | ||
if (params.length === 1) { | ||
let intValue = params[0].split(","); | ||
params = intValue; | ||
let onlyInt = params.filter((value, index) => { | ||
let nonIntegers = params.filter((value, index) => { | ||
return /^\d+$/.test(value); | ||
}); | ||
if (params.length !== onlyInt.length) { | ||
throw "Only numbers are allowed in subNumbers function."; | ||
if (params.length !== nonIntegers.length) { | ||
throw "Only numbers are allowed in addNumber function."; | ||
} | ||
} | ||
} else if (params.length !== onlyInt.length) { | ||
} else if (params.length !== nonIntegers.length) { | ||
throw "Only numbers are allowed in addNumber function."; | ||
@@ -23,0 +23,0 @@ } |
@@ -6,17 +6,17 @@ function subNumbers(...arg) { | ||
} | ||
let onlyInt = params.filter((value, index) => { | ||
let nonIntegers = params.filter((value, index) => { | ||
return /^\d+$/.test(value); | ||
}); | ||
if (onlyInt.length === 0) { | ||
if (nonIntegers.length === 0) { | ||
if (params.length === 1) { | ||
let intValue = params[0].split(","); | ||
params = intValue; | ||
let onlyInt = params.filter((value, index) => { | ||
let nonIntegers = params.filter((value, index) => { | ||
return /^\d+$/.test(value); | ||
}); | ||
if (params.length !== onlyInt.length) { | ||
if (params.length !== nonIntegers.length) { | ||
throw "Only numbers are allowed in subNumbers function."; | ||
} | ||
} | ||
} else if (params.length !== onlyInt.length) { | ||
} else if (params.length !== nonIntegers.length) { | ||
throw "Only numbers are allowed in subNumbers function."; | ||
@@ -23,0 +23,0 @@ } |
{ | ||
"name": "react-native-math-expressions-mb", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "react-native math expressions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
2827