Reformat all files with prettier

This commit is contained in:
Pieter Vander Vennet 2022-09-08 21:40:48 +02:00
parent e22d189376
commit b541d3eab4
382 changed files with 50893 additions and 35566 deletions

View file

@ -1,8 +1,10 @@
import * as fs from "fs";
import * as fs from "fs"
function main(args) {
if (args.length < 2) {
console.log("Given a single geojson file and an attribute-key, will generate a new file for every value of the partition.")
console.log(
"Given a single geojson file and an attribute-key, will generate a new file for every value of the partition."
)
console.log("USAGE: perProperty `file.geojson` `property-key`")
return
}
@ -24,15 +26,14 @@ function main(args) {
const stripped = path.substr(0, path.length - ".geojson".length)
perProperty.forEach((features, v) => {
fs.writeFileSync(stripped + "." + v.replace(/[^a-zA-Z0-9_]/g, "_") + ".geojson",
fs.writeFileSync(
stripped + "." + v.replace(/[^a-zA-Z0-9_]/g, "_") + ".geojson",
JSON.stringify({
type: "FeatureCollection",
features
}))
features,
})
)
})
}
main(process.argv.slice(2))