Skip to content

Commit 4e0fab9

Browse files
committed
Refactoring
1 parent 00cd656 commit 4e0fab9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/devextreme/js/__internal/grids/grid_core/ai_column/m_ai_column_cache_controller.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Controller } from '../m_modules';
22

33
export class AIColumnCacheController extends Controller {
4-
private readonly cache: Record<string, Record<PropertyKey, string>> = {};
4+
private readonly cache: Record<string, Record<PropertyKey, string> | undefined> = {};
55

66
public clearCache(columnName: string): void {
7-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
8-
delete this.cache[columnName];
7+
this.cache[columnName] = undefined;
98
}
109

1110
public getCachedResponse(columnName: string, keys: PropertyKey[]):
@@ -40,6 +39,6 @@ export class AIColumnCacheController extends Controller {
4039
}
4140

4241
public isEmptyCache(columnName: string): boolean {
43-
return Object.keys(this.cache[columnName] || {}).length === 0;
42+
return Object.keys(this.cache[columnName] ?? {}).length === 0;
4443
}
4544
}

0 commit comments

Comments
 (0)