mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
chore: parse DEBUG setting as an object
This commit is contained in:
parent
6d69eb855f
commit
5ac99d180d
8 changed files with 28 additions and 17 deletions
|
|
@ -56,3 +56,11 @@ JSON.isValid = str => {
|
|||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
JSON.safeParse = str => {
|
||||
try {
|
||||
return JSON.parse(str);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue