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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-scale",
3
- "version": "1.4.46",
3
+ "version": "1.4.47",
4
4
  "main": "./index.js",
5
5
  "type": "module",
6
6
  "scripts": {
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 > 0
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)) {