export type Config = { /** * Parser for the received string from the request. * By default, the parser is set to `JSON.parse`. * * @param data the request string **/ parser: (data: string) => any /** * Stringify method for passing back data as a response. * By default, the stringify method is set to `JSON.stringify`. * * @param data the response object */ stringify: (data: any) => string } export const DEFAULT_CONFIG: Config = { parser: JSON.parse, stringify: JSON.stringify, }