Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
readGeoJSON({ path }, (error, { finished, feature, next }) => {
// handle read errors
if (error) {
return done(error);
}
// handle read finish
if (finished) {
return done();
}
// process features
if (isFeature(feature) && get(feature, 'properties.name') && next) {
// prepare feature seed
const hospital = {
namespace: 'Feature', // TODO: CriticalFacility
strings: {
name: { en: get(feature, 'properties.name') },
},
geos: { geometry: get(feature, 'geometry') },
properties: get(feature, 'properties'),
populate: {
'relations.type': {
match: { namespace: 'FeatureType', 'strings.name.en': 'Hospital' },
model: 'Predefine',
},
},
};
// seed feature