Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getWikidataPlaceInfo(action, next) {
const id = action.feature.properties.wikidata;
const url = wdk.getEntities({
ids: id,
languages: ["en"]
});
fetch(url, { method: "get" })
.then(res => {
if (res.ok) {
return res.json();
} else {
// 4xx or 5xx response
var err = new Error(res.statusText);
return Promise.reject(err);
}
})
.then(data => {
// Success