Null coalesce
This commit is contained in:
parent
fd02085b10
commit
56521c2744
1 changed files with 2 additions and 2 deletions
|
|
@ -4,11 +4,11 @@ import { packageNames } from "@/constants/package-names";
|
|||
|
||||
export function containsLineItemWithPartType(typeToFind, itemsToSearch) {
|
||||
const partTypeMatches = findLineItemsWithPartType(typeToFind, itemsToSearch);
|
||||
return !!partTypeMatches.length;
|
||||
return !!partTypeMatches?.length;
|
||||
}
|
||||
|
||||
export function findLineItemsWithPartType(typeToFind, itemsToSearch) {
|
||||
const partTypeMatches = itemsToSearch.filter(
|
||||
const partTypeMatches = itemsToSearch?.filter(
|
||||
(lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase()
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue