ch-a-os / DocSort

Digitize and access everything, everywhere.
GNU General Public License v3.0
0 stars 1 forks source link

Manually parse and validate config #103

Closed Mondei1 closed 5 years ago

Mondei1 commented 5 years ago

Currently we just read the config with TypeScript and validates the data types. But what If the user enters a negative number? Right, TypeScript will see it as valid number because it's a valid number but that is something we don't want.

We should read the JSON file with fs and parse it with JSON.parse. We have a default config hardcoded and we just update the values with what we read from the config.json If exist. So we have a better way for backward compatibility for later versions too.