From e7d9dbc886382a0c372f077ccb5b19fd927a3dcd Mon Sep 17 00:00:00 2001 From: Bernd Storath <999999bst@gmail.com> Date: Thu, 5 Mar 2026 11:52:47 +0100 Subject: [PATCH] fix ec mode order --- src/server/utils/qr.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/utils/qr.ts b/src/server/utils/qr.ts index 5e4dced5..a597be7a 100644 --- a/src/server/utils/qr.ts +++ b/src/server/utils/qr.ts @@ -1,7 +1,7 @@ // ! Auto Imports are not supported in this file import type { ErrorCorrection } from 'qr'; -import { encodeQR, ECMode } from 'qr'; +import { encodeQR } from 'qr'; export function encodeQRCode(config: string): string { return tryECCModes((ecc) => { @@ -23,6 +23,8 @@ export function encodeQRCodeTerm(config: string): string { } function tryECCModes(callback: (ecc: ErrorCorrection) => T): T { + // defined manually, as qr's ECMode is in wrong order + const ECMode = ['high', 'quartile', 'medium', 'low'] as const; for (const ecc of ECMode) { try { return callback(ecc);