Skip to content

Commit

Permalink
fix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
eegli committed Dec 9, 2021
1 parent 59f0967 commit 53d2f1e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion maps/switzerland.json

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions scripts/geojson-maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ const REQUIRED_PROP = 'name';
type: 'input',
when: answers => answers.shouldFilter,
},
{
name: 'shouldDeduplicate',
message: `${fileName}: Do you want to deduplicate the maps based on ${REQUIRED_PROP}?`,
type: 'confirm',
default: false,
},
{
name: 'newFileName',
message: `${fileName}: (Optional) Enter new file name without extension (hit enter to skip):`,
Expand All @@ -83,7 +77,6 @@ const REQUIRED_PROP = 'name';
shouldFilter,
propToExclude,
propToExcludeValue,
shouldDeduplicate,
newFileName,
}) => {
const newFeatures = geojson.features.reduce((acc, curr) => {
Expand All @@ -96,17 +89,6 @@ const REQUIRED_PROP = 'name';
// Create REQUIRED_PROP property
curr.properties[REQUIRED_PROP] = curr.properties[propToRename];

// Don't add duplicate features
if (
shouldDeduplicate &&
acc.find(
f =>
f.properties[REQUIRED_PROP] === curr.properties[REQUIRED_PROP]
)
) {
return acc;
}

if (shouldDeleteOtherProps) {
// Delete other properties
Object.keys(curr.properties).forEach(prop => {
Expand Down

0 comments on commit 53d2f1e

Please sign in to comment.