fix eslint warnigs for core project (#7506)

This commit is contained in:
Denys Vuika
2022-02-17 14:35:33 +00:00
committed by GitHub
parent 5b7f255eec
commit bca5a783ab
246 changed files with 5127 additions and 5065 deletions

View File

@@ -74,7 +74,7 @@ export class NodeFavoriteDirective implements OnChanges {
if (every) {
const batch = this.favorites.map((selected: NodeEntry | SharedLinkEntry) => {
// shared files have nodeId
const id = (<SharedLinkEntry> selected).entry.nodeId || selected.entry.id;
const id = (selected as SharedLinkEntry).entry.nodeId || selected.entry.id;
return from(this.favoritesApi.deleteFavorite('-me-', id));
});
@@ -92,7 +92,7 @@ export class NodeFavoriteDirective implements OnChanges {
const notFavorite = this.favorites.filter((node) => !node.entry.isFavorite);
const body: FavoriteBody[] = notFavorite.map((node) => this.createFavoriteBody(node));
from(this.favoritesApi.createFavorite('-me-', <any> body))
from(this.favoritesApi.createFavorite('-me-', body as any))
.subscribe(
() => {
notFavorite.map((selected) => selected.entry.isFavorite = true);
@@ -138,8 +138,8 @@ export class NodeFavoriteDirective implements OnChanges {
}
// ACS 5.x and 6.x without 'isFavorite' include
const { name, isFile, isFolder } = <Node> node;
const id = (<SharedLink> node).nodeId || node.id;
const { name, isFile, isFolder } = node as Node;
const id = (node as SharedLink).nodeId || node.id;
const promise = this.favoritesApi.getFavorite('-me-', id);
@@ -153,17 +153,15 @@ export class NodeFavoriteDirective implements OnChanges {
isFavorite: true
}
})),
catchError(() => {
return of({
entry: {
id,
isFolder,
isFile,
name,
isFavorite: false
}
});
})
catchError(() => of({
entry: {
id,
isFolder,
isFile,
name,
isFavorite: false
}
}))
);
}