Added implementation for setBeacons along with some tests

This commit is contained in:
Alexander Cerutti
2021-09-19 19:52:08 +02:00
parent a73b367a62
commit 8a814e46f0
3 changed files with 81 additions and 5 deletions

View File

@@ -245,3 +245,14 @@ export function getValidated<T extends Object>(
return validation.value;
}
export function filterValid<T extends Object>(
source: T[],
schema: AvailableSchemas,
): T[] {
if (!source) {
return [];
}
return source.filter((current) => isValid(current, schema));
}