fix: fix various typos

This commit is contained in:
Wieland Schöbl
2021-05-21 15:35:26 +02:00
parent 1d94dd5bf3
commit ad0dae46ff
16 changed files with 49 additions and 49 deletions

View File

@@ -80,9 +80,9 @@ export class DataFacetsProvider {
}
const combinedFacets: SCFacet[] = facets;
const combinedFacetsMap: {[key: string]: {[key: string]: number; }; } = this.facetsToMap(combinedFacets);
(items as any[]).forEach((item) => {
items.forEach((item) => {
aggregations.forEach((aggregation) => {
let fieldValues: string | string[] = item[aggregation.fieldName];
let fieldValues = item[aggregation.fieldName as keyof SCThing] as string | string[] | undefined;
if (typeof fieldValues === 'undefined') {
return;
}

View File

@@ -86,7 +86,7 @@ export class DataProvider {
}
/**
* Provides a saveable thing from the local database using the provided UID
* Provides a savable thing from the local database using the provided UID
*/
async get(uid: string, scope: DataScope.Local): Promise<SCSaveableThing<SCThings>>;
/**
@@ -148,10 +148,10 @@ export class DataProvider {
* Save a data item
*
* @param item Data item that needs to be saved
* @param [type] Saveable type (e.g. 'favorite'); if nothing is provided then type of the thing is used
* @param [type] Savable type (e.g. 'favorite'); if nothing is provided then type of the thing is used
*/
async put(item: SCThings, type?: SCThingType): Promise<SCSaveableThing<SCThings>> {
const saveableItem: SCSaveableThing<SCThings> = {
const savableItem: SCSaveableThing<SCThings> = {
data: item,
name: item.name,
origin: {
@@ -163,7 +163,7 @@ export class DataProvider {
};
// @TODO: Implementation for saving item into the backend (user's account)
return ( this.storageProvider.put<SCSaveableThing<SCThings>>(this.getDataKey(item.uid), saveableItem));
return ( this.storageProvider.put<SCSaveableThing<SCThings>>(this.getDataKey(item.uid), savableItem));
}
/**

View File

@@ -87,7 +87,7 @@ describe('DataDetailComponent', () => {
expect(comp).toBeDefined(),
);
it('should have apropriate title', async () => {
it('should have appropriate title', async () => {
const title: DebugElement | null = detailPage.query(By.directive(IonTitle));
expect(title).not.toBe(null);
expect(title!.nativeElement.textContent).toBe('Foo');

View File

@@ -43,14 +43,14 @@ export class SimpleCardComponent {
* TODO
*/
// tslint:disable-next-line:prefer-function-over-method
isString(data: any): data is string {
isString(data: unknown): data is string {
return typeof data === 'string';
}
/**
* TODO
*/
// tslint:disable-next-line:prefer-function-over-method
isThing(something: any): something is SCThing {
isThing(something: unknown): something is SCThing {
return isThing(something);
}
}

View File

@@ -17,12 +17,12 @@ import {Injectable} from '@angular/core';
import {HttpClientInterface, HttpClientRequest} from '@openstapps/api/lib/http-client-interface';
/**
* HttpClient that is based on angular's HttpClient (@TODO: move it to provider or independent package)
* HttpClient that is based on the Angular HttpClient (@TODO: move it to provider or independent package)
*/
@Injectable()
export class StAppsWebHttpClient implements HttpClientInterface {
/**
*
*
* @param http TODO
*/
constructor(private readonly http: HttpClient) {
@@ -39,7 +39,7 @@ export class StAppsWebHttpClient implements HttpClientInterface {
/**
* TODO
*/
[key: string]: any;
[key: string]: unknown;
/**
* TODO
*/
@@ -63,6 +63,7 @@ export class StAppsWebHttpClient implements HttpClientInterface {
requestConfig.method || 'GET', requestConfig.url.toString(), options)
.toPromise();
// tslint:disable-next-line:prefer-object-spread
return Object.assign(response, {statusCode: response.status, body: response.body || {}});
} catch (err) {
throw Error(err);

View File

@@ -55,7 +55,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
startingDay: Moment;
constructor(private mensaService: PlaceMensaService, private changeDectectorRef: ChangeDetectorRef) {
constructor(private mensaService: PlaceMensaService, private changeDetectorRef: ChangeDetectorRef) {
// TODO: translation
this.startingDay = moment();
this.startingDay.hour(0);
@@ -76,7 +76,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
break;
}
}
this.changeDectectorRef.detectChanges();
this.changeDetectorRef.detectChanges();
return out;
});