mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-20 20:32:23 -06:00
refactor(eslint): update TypeScript object type usage and adjust linting rules
- Change usage of `Object` to `object` in various files for better type safety. - Update ESLint configuration to change `@typescript-eslint/no-unused-vars` from 'error' to 'warn' and disable certain rules related to object types.
This commit is contained in:
@@ -105,7 +105,7 @@ export class EventManager {
|
||||
instanceName: string;
|
||||
origin: string;
|
||||
event: string;
|
||||
data: Object;
|
||||
data: object;
|
||||
serverUrl: string;
|
||||
dateTime: string;
|
||||
sender: string;
|
||||
|
||||
@@ -431,7 +431,7 @@ export class ChannelStartupService {
|
||||
return data;
|
||||
}
|
||||
|
||||
public async sendDataWebhook<T = any>(event: Events, data: T, local = true, integration?: string[]) {
|
||||
public async sendDataWebhook<T extends object = any>(event: Events, data: T, local = true, integration?: string[]) {
|
||||
const serverUrl = this.configService.get<HttpServer>('SERVER').URL;
|
||||
const tzoffset = new Date().getTimezoneOffset() * 60000; //offset in milliseconds
|
||||
const localISOTime = new Date(Date.now() - tzoffset).toISOString();
|
||||
|
||||
4
src/cache/localcache.ts
vendored
4
src/cache/localcache.ts
vendored
@@ -53,7 +53,7 @@ export class LocalCache implements ICache {
|
||||
|
||||
async hGet(key: string, field: string) {
|
||||
try {
|
||||
const data = LocalCache.localCache.get(this.buildKey(key)) as Object;
|
||||
const data = LocalCache.localCache.get(this.buildKey(key)) as object;
|
||||
|
||||
if (data && field in data) {
|
||||
return JSON.parse(data[field], BufferJSON.reviver);
|
||||
@@ -84,7 +84,7 @@ export class LocalCache implements ICache {
|
||||
|
||||
async hDelete(key: string, field: string) {
|
||||
try {
|
||||
const data = LocalCache.localCache.get(this.buildKey(key)) as Object;
|
||||
const data = LocalCache.localCache.get(this.buildKey(key)) as object;
|
||||
|
||||
if (data && field in data) {
|
||||
delete data[field];
|
||||
|
||||
Reference in New Issue
Block a user