Skip to content

Commit ddb4352

Browse files
use util functions from dev branch
1 parent d69c421 commit ddb4352

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

lib/common/util/text.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @flow
2+
3+
import toLower from 'lodash/toLower'
4+
import upperFirst from 'lodash/upperFirst'
5+
6+
export default function toSentenceCase (s: string): string {
7+
return upperFirst(toLower(s))
8+
}

lib/editor/util/map.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ type R5Response = {
4444
}>
4545
}
4646

47-
export const stopIsOutOfBounds = (stop: GtfsStop, bounds: any) => {
48-
return stop.stop_lat > bounds.getNorth() ||
49-
stop.stop_lat < bounds.getSouth() ||
50-
stop.stop_lon > bounds.getEast() ||
51-
stop.stop_lon < bounds.getWest()
47+
export const coordIsOutOfBounds = (coords: LatLng, bounds: Bounds) => {
48+
if (!coords || !coords.lat || !coords.lng || !bounds) return true
49+
50+
return coords.lat > bounds.getNorth() ||
51+
coords.lat < bounds.getSouth() ||
52+
coords.lng > bounds.getEast() ||
53+
coords.lng < bounds.getWest()
54+
}
55+
export const stopIsOutOfBounds = (stop: GtfsStop, bounds: Bounds) => {
56+
return coordIsOutOfBounds({lat: stop.stop_lat, lng: stop.stop_lon}, bounds)
5257
}
5358

5459
export const getStopIcon = (

0 commit comments

Comments
 (0)