import { ConverterSet, ConverterType } from '../domain.js'; export const timestamp: ConverterSet = { types: ['google.protobuf.Timestamp'], [ConverterType.TO_JSON]: { transform: (val: Date | string) => { if (typeof val === 'string' || !val) { return val; } return val.toISOString(); }, }, [ConverterType.FROM_JSON]: { transform: (val: string) => (val ? new Date(val) : val), }, };