From a4bfd172514912aee8565f26fa41eada9b185f2c Mon Sep 17 00:00:00 2001 From: Katja Lutz Date: Wed, 14 Sep 2022 16:42:36 +0200 Subject: [PATCH] refactor: create constant for swiss qr line breaks --- src/components/SwissInvoice.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/SwissInvoice.tsx b/src/components/SwissInvoice.tsx index 01d4f96..d8fc5dd 100644 --- a/src/components/SwissInvoice.tsx +++ b/src/components/SwissInvoice.tsx @@ -55,6 +55,7 @@ const encodeSwissQrInvoice = ( ) => { const VERSION = "0220"; // 2.20 const CODING = 1; // utf-8 + const LINE_BREAK = "\n"; const END_INDICATOR = "EPD"; const creditorType = invoiceData.creditor.type || "S"; @@ -115,7 +116,7 @@ const encodeSwissQrInvoice = ( END_INDICATOR, ] .flat() - .join("\n"); + .join(LINE_BREAK); return invoice; };