Skip to content

Commit

Permalink
reduce reliance on lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Dec 3, 2024
1 parent 37d926c commit 224e784
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/services/Task/BoundedTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { addError } from '../Error/Error'
import AppErrors from '../Error/AppErrors'
import _get from 'lodash/get'
import _values from 'lodash/values'
import _isArray from 'lodash/isArray'
import _isUndefined from 'lodash/isUndefined'
import _map from 'lodash/map'
import { generateSearchParametersString } from '../Search/Search'
Expand Down Expand Up @@ -93,7 +92,7 @@ export const fetchBoundedTaskMarkers = function(criteria, limit = 50, skipDispat
// If we are searching within map bounds we need to ensure the parent
// challenge is also within those bounds
if (filters.location === CHALLENGE_LOCATION_WITHIN_MAPBOUNDS) {
if (_isArray(criteria.boundingBox)) {
if (Array.isArray(criteria.boundingBox)) {
searchParameters.bb = criteria.boundingBox.join(',')
} else {
searchParameters.bb = criteria.boundingBox
Expand Down Expand Up @@ -200,7 +199,7 @@ export const fetchBoundedTasks = function(criteria, limit=50, skipDispatch=false
// If we are searching within map bounds we need to ensure the parent
// challenge is also within those bounds
if (filters.location === CHALLENGE_LOCATION_WITHIN_MAPBOUNDS) {
if (_isArray(criteria.boundingBox)) {
if (Array.isArray(criteria.boundingBox)) {

Check warning on line 202 in src/services/Task/BoundedTask.js

View check run for this annotation

Codecov / codecov/patch

src/services/Task/BoundedTask.js#L202

Added line #L202 was not covered by tests
searchParameters.bb = criteria.boundingBox.join(',')
}
else {
Expand Down Expand Up @@ -276,7 +275,7 @@ export const currentBoundedTasks = function(state={}, action) {
updatedTasks.loading = true
}
else {
updatedTasks.tasks = _isArray(action.tasks) ? action.tasks : []
updatedTasks.tasks = Array.isArray(action.tasks) ? action.tasks : []

Check warning on line 278 in src/services/Task/BoundedTask.js

View check run for this annotation

Codecov / codecov/patch

src/services/Task/BoundedTask.js#L278

Added line #L278 was not covered by tests
updatedTasks.loading = false
updatedTasks.totalCount = action.totalCount
}
Expand Down

0 comments on commit 224e784

Please sign in to comment.