From 77049fdd61770043ba7ab8d656cc4c928433a3b9 Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Fri, 9 Jun 2023 12:55:55 +0200 Subject: [PATCH] chore: refactor --- src/serializers.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/serializers.ts b/src/serializers.ts index b3281b75..fe8e9595 100755 --- a/src/serializers.ts +++ b/src/serializers.ts @@ -21,11 +21,6 @@ const commandNameSerializer = (command: Commands): string => command const splitCommandSerializer = (command: Commands): string => command.split(' ')[0] const splitCommandKeywordSerializer = (command: Commands): string => command.split(' ')[1] -function customCommandNameSerializer(keyword: string) { - // Instead of using the command name, use a custom keyword - return (_command: Commands): string => keyword -} - const channelSerializer = (_command: Commands, { channel }: { channel: number }): string => channel + '' const channelLayerSerializer = (_command: Commands, { channel, layer }: { channel: number; layer: number }): string => `${channel}-${layer}` @@ -453,8 +448,8 @@ export const serializers: Readonly> = { [Commands.Tls]: [commandNameSerializer, (_, { subDirectory }) => subDirectory ?? ''], [Commands.Version]: [commandNameSerializer], [Commands.Info]: [commandNameSerializer], - [Commands.InfoChannel]: [customCommandNameSerializer('INFO'), channelSerializer], - [Commands.InfoLayer]: [customCommandNameSerializer('INFO'), channelLayerSerializer], + [Commands.InfoChannel]: [splitCommandSerializer, channelSerializer], + [Commands.InfoLayer]: [splitCommandSerializer, channelLayerSerializer], [Commands.InfoTemplate]: [commandNameSerializer, (_, { template }) => template], [Commands.InfoConfig]: [commandNameSerializer], [Commands.InfoPaths]: [commandNameSerializer],