1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Bump typescript to 4.9.3 (#14430)

This commit is contained in:
Bram Kragten
2022-11-21 20:27:47 +01:00
committed by GitHub
parent 2aa7b95a5a
commit fc80daa3e0
8 changed files with 1060 additions and 940 deletions

View File

@@ -61,7 +61,9 @@ const triggerPhrases = {
};
const DATA_CACHE: {
[cacheKey: string]: { [entityId: string]: Promise<LogbookEntry[]> };
[cacheKey: string]: {
[entityId: string]: Promise<LogbookEntry[]> | undefined;
};
} = {};
export const getLogbookDataForContext = async (
@@ -115,11 +117,11 @@ const getLogbookDataCache = async (
}
if (entityIdKey in DATA_CACHE[cacheKey]) {
return DATA_CACHE[cacheKey][entityIdKey];
return DATA_CACHE[cacheKey][entityIdKey]!;
}
if (entityId && DATA_CACHE[cacheKey][ALL_ENTITIES]) {
const entities = await DATA_CACHE[cacheKey][ALL_ENTITIES];
const entities = await DATA_CACHE[cacheKey][ALL_ENTITIES]!;
return entities.filter(
(entity) => entity.entity_id && entityId.includes(entity.entity_id)
);
@@ -131,7 +133,7 @@ const getLogbookDataCache = async (
endDate,
entityId
);
return DATA_CACHE[cacheKey][entityIdKey];
return DATA_CACHE[cacheKey][entityIdKey]!;
};
const getLogbookDataFromServer = (