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,6 +1,6 @@
import fs from "fs";
import {GeoOperations} from "../Logic/GeoOperations";
import ScriptUtils from "./ScriptUtils";
import fs from "fs"
import { GeoOperations } from "../Logic/GeoOperations"
import ScriptUtils from "./ScriptUtils"
/**
* Given one of more files, calculates a somewhat convex hull for them
@ -10,21 +10,19 @@ import ScriptUtils from "./ScriptUtils";
function makeConvex(file) {
ScriptUtils.erasableLog("Handling", file)
const geoJson = JSON.parse(fs.readFileSync(file, "UTF8"))
const convex = GeoOperations.convexHull(geoJson, {concavity: 2})
const convex = GeoOperations.convexHull(geoJson, { concavity: 2 })
if (convex.properties === undefined) {
convex.properties = {}
}
fs.writeFileSync(file + ".convex.geojson", JSON.stringify(convex))
}
let args = [...process.argv]
args.splice(0, 2)
args.forEach(file => {
args.forEach((file) => {
try {
makeConvex(file)
} catch (e) {
console.error("Could not handle file ", file, " due to ", e)
}
})
})