import TypeConverter from './TypeConverter' ; class NumberConverter extends TypeConverter { constructor ( key ) { super ( key , 'number' ) ; } convertFrom ( val ) { if ( isNaN ( + val ) ) throw new Error ( val + ' is not a valid number' ) ; return + val ; } convertTo ( val ) { return { val : '' + val } ; } } export default NumberConverter ;