2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-06 07:20:40 +00:00

Do not use optional catch binding in core

This commit is contained in:
Vjacheslav Trushkin 2022-04-29 23:30:20 +03:00
parent b183dade9d
commit 4601d540ef
3 changed files with 11 additions and 11 deletions

View File

@ -27,7 +27,7 @@ const detectFetch = (): FetchType | null => {
if (typeof callback === 'function') {
return callback;
}
} catch {
} catch (err) {
//
}

View File

@ -89,7 +89,7 @@ function getGlobal(key: keyof StorageConfig): typeof localStorage | null {
) {
return _window[attr];
}
} catch {
} catch (err) {
//
}
@ -110,7 +110,7 @@ function setCount(
storage.setItem(countKey, value.toString());
count[key] = value;
return true;
} catch {
} catch (err) {
//
}
return false;
@ -142,7 +142,7 @@ function initCache(
): void {
try {
storage.setItem(versionKey, cacheVersion);
} catch {
} catch (err) {
//
}
setCount(storage, key, 0);
@ -159,7 +159,7 @@ function destroyCache(storage: typeof localStorage): void {
for (let i = 0; i < total; i++) {
storage.removeItem(cachePrefix + i.toString());
}
} catch {
} catch (err) {
//
}
}
@ -214,7 +214,7 @@ export const loadCache: LoadIconsCache = (): void => {
const storage = getStorage(provider, prefix);
valid = addIconSet(storage, data.data).length > 0;
}
} catch {
} catch (err) {
valid = false;
}
@ -254,7 +254,7 @@ export const loadCache: LoadIconsCache = (): void => {
// Update total
setCount(func, key, total);
} catch {
} catch (err) {
//
}
}
@ -303,7 +303,7 @@ export const storeCache: CacheIcons = (
data,
};
func.setItem(cachePrefix + index.toString(), JSON.stringify(item));
} catch {
} catch (err) {
return false;
}
return true;

View File

@ -47,7 +47,7 @@ try {
if (w && w._iconifyStorage.version === storageVersion) {
storage = w._iconifyStorage.storage;
}
} catch {
} catch (err) {
//
}
@ -63,7 +63,7 @@ export function shareStorage(): void {
storage,
};
}
} catch {
} catch (err) {
//
}
}
@ -128,7 +128,7 @@ export function addIconToStorage(
storage.icons[name] = Object.freeze(fullIcon(icon));
return true;
}
} catch {
} catch (err) {
// Do nothing
}
return false;