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