From 861878f13de661eab5a1a2efcb41b68a76b6b7df Mon Sep 17 00:00:00 2001 From: Bernd Storath <999999bst@gmail.com> Date: Thu, 5 Mar 2026 11:38:44 +0100 Subject: [PATCH] improve --- src/cli/clients/qr.ts | 2 +- src/server/utils/qr.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cli/clients/qr.ts b/src/cli/clients/qr.ts index bc67f7c6..9c76d9ad 100644 --- a/src/cli/clients/qr.ts +++ b/src/cli/clients/qr.ts @@ -1,5 +1,5 @@ import { defineCommand } from 'citty'; -import consola from 'consola'; +import { consola } from 'consola'; import { eq } from 'drizzle-orm'; import { wg } from '../../server/utils/wgHelper'; diff --git a/src/server/utils/qr.ts b/src/server/utils/qr.ts index 67616c33..5e4dced5 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 { ECMode } from 'qr'; -import { encodeQR } from 'qr'; +import type { ErrorCorrection } from 'qr'; +import { encodeQR, ECMode } from 'qr'; export function encodeQRCode(config: string): string { return tryECCModes((ecc) => { @@ -22,8 +22,7 @@ export function encodeQRCodeTerm(config: string): string { }); } -function tryECCModes(callback: (ecc: (typeof ECMode)[number]) => T): T { - const ECMode = ['high', 'quartile', 'medium', 'low'] as const; +function tryECCModes(callback: (ecc: ErrorCorrection) => T): T { for (const ecc of ECMode) { try { return callback(ecc);