mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Fail when specified config is wrong or json is specified
This commit is contained in:
@ -9,11 +9,6 @@ const {
|
||||
} = require('./svgo.js');
|
||||
|
||||
const importConfig = async configFile => {
|
||||
try {
|
||||
await fs.promises.access(configFile);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
const config = require(configFile);
|
||||
if (config == null || typeof config !== 'object' || Array.isArray(config)) {
|
||||
throw Error(`Invalid config file "${configFile}"`);
|
||||
|
Reference in New Issue
Block a user