xy-scale 1.4.46 → 1.4.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/validators.js +2 -2
package/package.json
CHANGED
package/src/validators.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
export const isNumber = v => v != null && Number.isFinite(v)
|
|
3
3
|
|
|
4
|
-
export const isPositiveInteger = value => Number.isInteger(value) && value
|
|
4
|
+
export const isPositiveInteger = value => Number.isInteger(value) && value >= 0
|
|
5
5
|
|
|
6
6
|
export const isKeyPairObject = param => {
|
|
7
7
|
return (
|
|
@@ -138,7 +138,7 @@ export const arraysAreNotEqualSize = (list, callerName) => {
|
|
|
138
138
|
|
|
139
139
|
export const validateSizes = ({arrObjSize, trainSize, testSize}) => {
|
|
140
140
|
|
|
141
|
-
if(!isPositiveInteger(trainSize)) {
|
|
141
|
+
if(!isPositiveInteger(trainSize) || trainSize === 0) {
|
|
142
142
|
throw new Error(`Invalid property: "trainSize" (${trainSize}) must be a non-negative integer.`)
|
|
143
143
|
}
|
|
144
144
|
if(!isPositiveInteger(testSize)) {
|