1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-31 07:44:22 +03:00

Format lib with prettier (#1386)

Note: review with hidden whitespaces
This commit is contained in:
Bogdan Chadkin
2021-02-28 10:56:16 +03:00
committed by GitHub
parent a99cc08e4f
commit 71e47370bd
13 changed files with 1312 additions and 1282 deletions

View File

@ -8,7 +8,7 @@ const {
createContentItem,
} = require('./svgo.js');
const importConfig = async configFile => {
const importConfig = async (configFile) => {
const config = require(configFile);
if (config == null || typeof config !== 'object' || Array.isArray(config)) {
throw Error(`Invalid config file "${configFile}"`);
@ -23,7 +23,7 @@ const isFile = async (file) => {
} catch {
return false;
}
}
};
const loadConfig = async (configFile, cwd = process.cwd()) => {
if (configFile != null) {
@ -36,7 +36,7 @@ const loadConfig = async (configFile, cwd = process.cwd()) => {
let dir = cwd;
// eslint-disable-next-line no-constant-condition
while (true) {
const file = path.join(dir, "svgo.config.js");
const file = path.join(dir, 'svgo.config.js');
if (await isFile(file)) {
return await importConfig(file);
}