typo fixes + whitespace refactorings
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import { IEntity } from './IEntity';
|
||||
|
||||
export abstract class BaseEntity<TId> implements IEntity<TId> {
|
||||
constructor(public id: TId) {
|
||||
protected constructor(public id: TId) {
|
||||
if (typeof id !== 'number' && !id) {
|
||||
throw new Error('Id cannot be null or empty');
|
||||
}
|
||||
}
|
||||
|
||||
public equals(otherId: TId): boolean {
|
||||
return this.id === otherId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { IRepository } from './IRepository';
|
||||
|
||||
export class InMemoryRepository<TKey, TEntity extends IEntity<TKey>> implements IRepository<TKey, TEntity> {
|
||||
private readonly items: TEntity[];
|
||||
|
||||
constructor(items?: TEntity[]) {
|
||||
this.items = items || new Array<TEntity>();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export class SaveFileDialog {
|
||||
const blob = new Blob([file], { type: fileType });
|
||||
fileSaver.saveAs(blob, fileName);
|
||||
} catch (e) {
|
||||
window.open('data:' + fileType + ',' + encodeURIComponent(file.toString()), '_blank', '');
|
||||
window.open(`data:${fileType},${encodeURIComponent(file.toString())}`, '_blank', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export class AsyncLazy<T> {
|
||||
private isCreatingValue = false;
|
||||
private value: T | undefined;
|
||||
|
||||
constructor(private valueFactory: () => Promise<T>) { }
|
||||
constructor(private valueFactory: () => Promise<T>) {}
|
||||
|
||||
public setValueFactory(valueFactory: () => Promise<T>) {
|
||||
this.valueFactory = valueFactory;
|
||||
|
||||
Reference in New Issue
Block a user