Skip to content

Commit

Permalink
Bug fix for non string values.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstraughan committed Oct 17, 2024
1 parent 57a82bc commit 55c48a4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/app/shared/services/json-feed.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,11 @@ export abstract class JsonFeedService implements IFilterableService {
objectProperty = [objectProperty];
}

objectProperty = JsonFeedService.normalizeArray(objectProperty);
const requiredValues = JsonFeedService.normalizeArray(filterGroup.requiredValues);

if (!objectProperty.some(
(item: string) => filterGroup.requiredValues.includes(item))) {
(item: string) => requiredValues.includes(item))) {
return false;
}
} else {
Expand All @@ -249,6 +252,14 @@ export abstract class JsonFeedService implements IFilterableService {
return true;
}

/**
* Formalize an array into strings.
* @param array
*/
static normalizeArray(array: any[]): string[] {
return array.map((item: any) => item.toString().toLowerCase());
}

/**
* Generate a proper target feed URL using a base URL and a page number.
* @param baseUrl
Expand Down

0 comments on commit 55c48a4

Please sign in to comment.