Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import lonlat from '@conveyal/lonlat'
import {mapbox} from 'mapbox.js'
mapbox.accessToken = process.env.MAPBOX_ACCESS_TOKEN
const MAPBOX_TYPES = ['address', 'neighborhood', 'place', 'poi']
const geocoder = mapbox.geocoder('mapbox.places')
export function search (apiKey, text, {
boundary,
focusLatlng,
format
} = {}) {
return geocode({boundary, focusLatlng, text})
.then((results) => ({...results, features: results.features.slice(0, 3)}))
}
export function geocode ({
boundary,
focusLatlng,