Skip to content

Commit 0de1f0c

Browse files
authored
refactor(util): code refactor (#13872)
* refactor(util): code refactor * refactor(util): code refactor
1 parent a61e5aa commit 0de1f0c

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/util/normalizeConfig.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,7 @@ export function normalizeConfig(config) {
274274

275275
if (typeof transform === 'function') {
276276
transformers.DEFAULT = transform
277-
}
278-
279-
if (typeof transform === 'object' && transform !== null) {
277+
} else if (typeof transform === 'object' && transform !== null) {
280278
Object.assign(transformers, transform)
281279
}
282280

src/util/parseGlob.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export function parseGlob(pattern) {
1515

1616
if (glob.substr(0, 2) === './') {
1717
glob = glob.substr(2)
18-
}
19-
if (glob.charAt(0) === '/') {
18+
} else if (glob.charAt(0) === '/') {
2019
glob = glob.substr(1)
2120
}
2221

src/util/splitAtTopLevelOnly.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ export function splitAtTopLevelOnly(input, separator) {
2929
}
3030
}
3131

32-
if (isEscaped) {
33-
isEscaped = false
34-
} else if (char === '\\') {
35-
isEscaped = true
36-
}
32+
isEscaped = isEscaped ? false : char === '\\'
3733

3834
if (char === '(' || char === '[' || char === '{') {
3935
stack.push(char)

0 commit comments

Comments
 (0)