🔍 support for search
This commit is contained in:
@@ -11,14 +11,12 @@ export class Application implements IApplication {
|
||||
|
||||
constructor(
|
||||
public readonly name: string,
|
||||
public readonly repositoryUrl: string,
|
||||
public readonly version: number,
|
||||
public readonly categories: ReadonlyArray<ICategory>) {
|
||||
if (!name) {
|
||||
throw Error('Application has no name');
|
||||
}
|
||||
if (!version) {
|
||||
throw Error('Version cannot be zero');
|
||||
}
|
||||
if (!name) { throw Error('Application has no name'); }
|
||||
if (!repositoryUrl) { throw Error('Application has no repository url'); }
|
||||
if (!version) { throw Error('Version cannot be zero'); }
|
||||
this.flattened = flatten(categories);
|
||||
if (this.flattened.allCategories.length === 0) {
|
||||
throw new Error('Application must consist of at least one category');
|
||||
@@ -48,6 +46,10 @@ export class Application implements IApplication {
|
||||
public getAllScripts(): IScript[] {
|
||||
return this.flattened.allScripts;
|
||||
}
|
||||
|
||||
public getAllCategories(): ICategory[] {
|
||||
return this.flattened.allCategories;
|
||||
}
|
||||
}
|
||||
|
||||
function ensureNoDuplicates<TKey>(entities: ReadonlyArray<IEntity<TKey>>) {
|
||||
|
||||
Reference in New Issue
Block a user