File tree Expand file tree Collapse file tree 5 files changed +4917
-7
lines changed
Expand file tree Collapse file tree 5 files changed +4917
-7
lines changed Original file line number Diff line number Diff line change 22
33// export
44var tinyParams = ( url ) => {
5- if ( ! url || url === '' || ! / \? / . test ( url ) ) return { }
6- let q = url . split ( / \? ( .+ ) ? / ) [ 1 ] || '' ;
5+ if ( ! url ) return { }
6+ let qIdx = url . indexOf ( '?' ) ;
7+ if ( qIdx === - 1 ) return { }
8+ let q = url . slice ( qIdx + 1 ) ;
9+ if ( ! q ) return { }
710 let obj = { } ;
811 let ary = q . split ( '&' ) ;
912 ary . forEach ( ( q ) => {
Original file line number Diff line number Diff line change 11// export
22
33var tinyParams = ( function ( url ) {
4- if ( ! url || url === '' || ! / \? / . test ( url ) ) return { } ;
5- var q = url . split ( / \? ( .+ ) ? / ) [ 1 ] || '' ;
4+ if ( ! url ) return { } ;
5+ var qIdx = url . indexOf ( '?' ) ;
6+ if ( qIdx === - 1 ) return { } ;
7+ var q = url . slice ( qIdx + 1 ) ;
8+ if ( ! q ) return { } ;
69 var obj = { } ;
710 var ary = q . split ( '&' ) ;
811 ary . forEach ( function ( q ) {
You can’t perform that action at this time.
0 commit comments