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);