File tree Expand file tree Collapse file tree 1 file changed +9
-22
lines changed
Expand file tree Collapse file tree 1 file changed +9
-22
lines changed Original file line number Diff line number Diff line change @@ -98,30 +98,17 @@ export class Variant {
9898 const rawItems = val . split ( ',' )
9999 const itemsLen = rawItems . length
100100
101- if ( hasDecode ) {
102- const items : ( string | number | undefined ) [ ] = [ ]
103- for ( let j = 0 ; j < itemsLen ; j ++ ) {
104- const v = rawItems [ j ] ?? ''
105- if ( v === '.' ) {
106- items . push ( undefined )
107- } else {
108- const decoded = decodeURIComponentNoThrow ( v )
109- items . push ( isNumber ? Number ( decoded ) : decoded )
110- }
111- }
112- result [ key ] = items
113- } else {
114- const items : ( string | number | undefined ) [ ] = [ ]
115- for ( let j = 0 ; j < itemsLen ; j ++ ) {
116- const v = rawItems [ j ] ?? ''
117- if ( v === '.' ) {
118- items . push ( undefined )
119- } else {
120- items . push ( isNumber ? Number ( v ) : v )
121- }
101+ const items : ( string | number | undefined ) [ ] = [ ]
102+ for ( let j = 0 ; j < itemsLen ; j ++ ) {
103+ const v = rawItems [ j ] ?? ''
104+ if ( v === '.' ) {
105+ items . push ( undefined )
106+ } else {
107+ const w = hasDecode ? decodeURIComponentNoThrow ( v ) : v
108+ items . push ( isNumber ? Number ( w ) : w )
122109 }
123- result [ key ] = items
124110 }
111+ result [ key ] = items
125112 }
126113 }
127114 return result
You can’t perform that action at this time.
0 commit comments