mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Fix config type (#1573)
This commit is contained in:
@ -54,6 +54,9 @@ const loadConfig = async (configFile, cwd = process.cwd()) => {
|
||||
exports.loadConfig = loadConfig;
|
||||
|
||||
const optimize = (input, config) => {
|
||||
if (config == null) {
|
||||
config = {};
|
||||
}
|
||||
if (typeof config !== 'object') {
|
||||
throw Error('Config should be an object');
|
||||
}
|
||||
@ -62,7 +65,7 @@ const optimize = (input, config) => {
|
||||
js2svg: {
|
||||
// platform specific default for end of line
|
||||
eol: os.EOL === '\r\n' ? 'crlf' : 'lf',
|
||||
...(config == null ? null : config.js2svg),
|
||||
...config.js2svg,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user