🔍 support for search

This commit is contained in:
undergroundwires
2020-01-09 23:02:36 +01:00
parent cafe6e809a
commit 89862b2775
19 changed files with 202 additions and 88 deletions

View File

@@ -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>>) {