You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆕 Added support for JSON5
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { NitroLogger, NitroVersion } from '@nitrots/utils';
|
||||
import { NitroLogger, NitroVersion, parseConfigJsonFromResponse } from '@nitrots/utils';
|
||||
import { IConfigurationManager } from './IConfigurationManager';
|
||||
|
||||
export class ConfigurationManager implements IConfigurationManager
|
||||
@@ -54,11 +54,11 @@ export class ConfigurationManager implements IConfigurationManager
|
||||
|
||||
try
|
||||
{
|
||||
json = await response.json();
|
||||
json = await parseConfigJsonFromResponse(response, url);
|
||||
}
|
||||
catch(parseError)
|
||||
{
|
||||
throw new Error(`Invalid JSON in config "${ url }" — check for syntax errors like trailing commas or missing quotes (${ parseError.message })`);
|
||||
throw new Error(`Invalid config "${ url }" — JSON/JSON5 parse failed. JSON5 allows comments, trailing commas and unquoted keys (${ parseError.message })`);
|
||||
}
|
||||
|
||||
this.parseConfiguration(json);
|
||||
|
||||
Reference in New Issue
Block a user