Skip to content

Commit a87218e

Browse files
committed
perf: lint code
1 parent 7702b3d commit a87218e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/utils/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,21 @@ export function param(json) {
162162
* @returns {Object}
163163
*/
164164
export function param2Obj(url) {
165-
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
166-
if (!search) {
167-
return {}
165+
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
166+
if (!search) {
167+
return {}
168+
}
169+
const obj = {}
170+
const searchArr = search.split('&')
171+
searchArr.forEach(v => {
172+
const index = v.indexOf('=')
173+
if (index !== -1) {
174+
const name = v.substring(0, index)
175+
const val = v.substring(index + 1, v.length)
176+
obj[name] = val
168177
}
169-
const obj = {}
170-
const searchArr = search.split('&')
171-
searchArr.forEach(v => {
172-
const index = v.indexOf('=')
173-
if (index !== -1) {
174-
const name = v.substring(0, index)
175-
const val = v.substring(index + 1, v.length)
176-
obj[name] = val
177-
}
178-
})
179-
return obj
178+
})
179+
return obj
180180
}
181181

182182
/**

0 commit comments

Comments
 (0)