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