Skip to content

Commit

Permalink
Corregir todos los errores de "Unsafe assignment of an any value"
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-ayn committed Oct 9, 2024
1 parent 709a605 commit 3864739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/navigation/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,6 @@ admin.get = function () {
return cache.map(item => (Object.assign({}, item)));
});
};
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
(0, promisify_1.default)(admin);
exports.default = admin;
6 changes: 3 additions & 3 deletions src/navigation/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ admin.get = async function (): Promise<NavigationItem[]> {
const ids = await db.getSortedSetRange('navigation:enabled', 0, -1) as string[];
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
const data = await db.getObjects(ids.map(id => `navigation:enabled:${id}`)) as NavigationItem[];
cache = data.filter(Boolean).map((item) => {
cache = data.filter(Boolean).map((item: NavigationItem) => {
if (item.hasOwnProperty('groups')) {
try {
item.groups = JSON.parse(item.groups as string);
item.groups = JSON.parse(item.groups as string) as string[];
} catch (err) {
if (err instanceof Error) {
winston.error(err.stack);
Expand All @@ -144,7 +144,7 @@ admin.get = async function (): Promise<NavigationItem[]> {
return cache.map(item => ({ ...item }));
};

// eslint-disable-next-line @typescript-eslint/no-unsafe-call
promisify(admin);

export { };
export default admin;

0 comments on commit 3864739

Please sign in to comment.