Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (fieldData: JoinGeoShape) => {
let polygon: any;
if (isGeoShapePoint(fieldData)) {
return equal(searchPoint, tPoint(fieldData.coordinates));
}
if (isGeoShapeMultiPolygon(fieldData)) {
polygon = multiPolygon(fieldData.coordinates);
}
if (isGeoShapePolygon(fieldData)) {
polygon = tPolygon(fieldData.coordinates);
}
// Nothing matches so return false
if (!polygon) return false;
return pointInPolygon(searchPoint, polygon);
};
}