mirror of
https://github.com/Koenkk/zigbee-OTA.git
synced 2026-06-24 12:26:24 +00:00
Fix AutoDL issue with new models not in cache (#645)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zigbee-ota",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Koenkk/zigbee-OTA.git"
|
||||
|
||||
@@ -186,7 +186,11 @@ export async function getText(manufacturer: string, pageUrl: string): Promise<st
|
||||
return await response.text();
|
||||
}
|
||||
|
||||
export function getLatestImage<T>(list: T[], compareFn: (a: T, b: T) => number): T | undefined {
|
||||
export function getLatestImage<T>(list: T[] | undefined, compareFn: (a: T, b: T) => number): T | undefined {
|
||||
if (!list) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const sortedList = list.sort(compareFn);
|
||||
|
||||
return sortedList.slice(0, sortedList.length > 1 && process.env.PREV ? -1 : undefined).pop();
|
||||
|
||||
Reference in New Issue
Block a user