Removed function processRelevancySet

This commit is contained in:
Alexander Cerutti
2021-06-17 23:34:53 +02:00
parent 17de1c7d79
commit a442144ef1

View File

@@ -368,7 +368,7 @@ export class Pass {
return this; return this;
} }
const valid = processRelevancySet(Schemas.Beacon, data); const valid = getValidInArray(Schemas.Beacon, data);
if (valid.length) { if (valid.length) {
this[passProps]["beacons"] = valid; this[passProps]["beacons"] = valid;
@@ -391,7 +391,7 @@ export class Pass {
return this; return this;
} }
const valid = processRelevancySet(Schemas.Location, data); const valid = getValidInArray(Schemas.Location, data);
if (valid.length) { if (valid.length) {
this[passProps]["locations"] = valid; this[passProps]["locations"] = valid;
@@ -747,10 +747,6 @@ function barcodesFromUncompleteData(message: string): Schemas.Barcode[] {
); );
} }
function processRelevancySet<T>(schema: Joi.ObjectSchema<T>, data: T[]): T[] {
return getValidInArray(schema, data);
}
function getValidInArray<T>( function getValidInArray<T>(
schemaName: Joi.ObjectSchema<T>, schemaName: Joi.ObjectSchema<T>,
contents: T[], contents: T[],