Skip to content

Commit

Permalink
refactor(util): code refactor (#13872)
Browse files Browse the repository at this point in the history
* refactor(util): code refactor

* refactor(util): code refactor
  • Loading branch information
Simon-He95 committed Jun 24, 2024
1 parent a61e5aa commit 0de1f0c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/util/normalizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,7 @@ export function normalizeConfig(config) {

if (typeof transform === 'function') {
transformers.DEFAULT = transform
}

if (typeof transform === 'object' && transform !== null) {
} else if (typeof transform === 'object' && transform !== null) {
Object.assign(transformers, transform)
}

Expand Down
3 changes: 1 addition & 2 deletions src/util/parseGlob.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export function parseGlob(pattern) {

if (glob.substr(0, 2) === './') {
glob = glob.substr(2)
}
if (glob.charAt(0) === '/') {
} else if (glob.charAt(0) === '/') {
glob = glob.substr(1)
}

Expand Down
6 changes: 1 addition & 5 deletions src/util/splitAtTopLevelOnly.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ export function splitAtTopLevelOnly(input, separator) {
}
}

if (isEscaped) {
isEscaped = false
} else if (char === '\\') {
isEscaped = true
}
isEscaped = isEscaped ? false : char === '\\'

if (char === '(' || char === '[' || char === '{') {
stack.push(char)
Expand Down

0 comments on commit 0de1f0c

Please sign in to comment.