Skip to content

Commit

Permalink
only check for null or undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
busma13 committed Sep 27, 2024
1 parent 56a5344 commit f0d83b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/data-mate/src/document-matcher/logic-builder/ip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ function checkCidr(ip: string, range: any) {
}

function pRangeTerm(range: any) {
return function checkIP(ip: any) {
if (typeof ip !== 'string') return false;
if (isNonZeroCidr(ip)) {
return checkCidr(ip, range);
return function checkIP(ip: unknown) {
if (ip === null || ip === undefined) return false;
if (isNonZeroCidr(ip as any)) {
return checkCidr(ip as any, range);
}
if (isIP(ip)) return range.contains(ip);
if (isIP(ip as any)) return range.contains(ip);
return false;
};
}
Expand Down

0 comments on commit f0d83b4

Please sign in to comment.