import { SerDes , SerDesSingleton } from './types' ; export const dateTime = new SerDesSingleton ( { format : 'date-time' , serialize : ( d ) => { return d && d . toISOString ( ) ; } , deserialize : ( s ) => { return new Date ( s ) ; } } ) ; export const date = new SerDesSingleton ( { format : 'date' , serialize : ( d ) => { return d && d . toISOString ( ) . split ( 'T' ) [ 0 ] ; } , deserialize : ( s ) => { return new Date ( s ) ; } } ) ; export const defaultSerDes = [ date . serializer , dateTime . serializer ] ;