import ConfigFieldBaseType from './base';

class NumberType extends ConfigFieldBaseType {
  constructor(min, max) {
    super();

    this.validators.push(val => typeof val === 'number');

    if (min !== null && min !== undefined) {
      this.validators.push(val => val > min);
    }

    if (max !== null && max !== undefined) {
      this.validators.push(val => val < max);
    }
  }
}

module.exports = NumberType;

@@ -1,26 +1,15 @@
 import 
-ConfigField
 BaseType
@@ -54,19 +54,8 @@
 nds 
-ConfigField
 Base
@@ -79,16 +79,18 @@
 tor(
+%7B 
 min, max
 ) %7B%0A
@@ -85,16 +85,23 @@
 min, max
+ %7D = %7B%7D
 ) %7B%0A    
@@ -115,35 +115,43 @@
 ;%0A%0A    this.
-valid
+transform
 ators.
+pre.
 push(val =%3E 
@@ -154,229 +154,246 @@
  =%3E 
-typeof val === 'number');%0A%0A    if (min !== null && min !== undefined) %7B%0A      this.validators.push(val =%3E val %3E min);%0A    %7D%0A%0A    if (max !== null && max !== undefined) %7B%0A      this.validators.push(val =%3E
+Number(val));%0A%0A    this.validators.push(val =%3E !isNaN(val));%0A%0A    this.validators.push(val =%3E%0A      ((typeof min === 'number') ? val %3E= min : true));%0A%0A    this.validators.push(val =%3E%0A      ((typeof max === 'number') ?
  val %3C
+=
  max
-);%0A    %7D
+ : true));
 %0A  %7D

Edit validation and transformation process in Number type