Added suggestions by @sourcery-ai

This commit is contained in:
w35l3y 2025-06-01 18:26:53 -03:00 committed by GitHub
parent bbbe667cfa
commit 460c893c3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,9 @@ import { Logger } from '@config/logger.config';
const logger = new Logger('PGPATH2MYSQL');
function convertPgPathToMysql (path) {
if (!Array.isArray(path)) return path
if (!Array.isArray(path)) {
return path
}
let result = '$'
for (const item of path) {
if (/^\d+$/.test(item)) {

View File

@ -1509,7 +1509,7 @@ export class BaileysStartupService extends ChannelStartupService {
remoteJid: key.remoteJid,
fromMe: key.fromMe,
participant: key?.remoteJid,
status: status[update.status] || findMessage.status,
status: status[update.status] ?? findMessage.status,
pollUpdates,
instanceId: this.instanceId,
};

View File

@ -60,7 +60,7 @@ if (configService.get<ProviderSession>('PROVIDER').ENABLED) {
const provider = configService.get<Database>('DATABASE').PROVIDER;
let extendablePrismaRepository: PrismaRepository = new PrismaRepository(configService)
if (provider === "mysql") {
if (typeof provider === 'string' && provider?.toLowerCase() === 'mysql') {
extendablePrismaRepository = extendsWithProxy(extendablePrismaRepository, pgPathToMysql);
}
export const prismaRepository = extendablePrismaRepository;