File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -92,10 +92,26 @@ var url = qsm.encode('www.myurl.com', obj);
9292
9393```
9494
95+ #### Encode with specific parameter
96+ ``` javascript
97+ var obj = {a: ' QSM' , version: 1.2 };
98+ var url = qsm .encode (' www.myurl.com' , obj, ' appVersion' );
99+ // url === 'www.myurl.com?appVersion=e2E6ICdRU00nLCB2ZXJzaW9uOiAxLjJ9'
100+
101+ ```
102+
95103### Decode
96104Decodes an query string from the inputted URL, returns either string or object.
105+ * Decodes by default the Q parameter*
97106``` javascript
98107var url = ' www.myurl.com?q=e2E6ICdRU00nLCB2ZXJzaW9uOiAxLjJ9' ;
99- var ret = qsm .decode (url, ' q ' );
108+ var ret = qsm .decode (url);
100109// ret === {a: 'QSM', version: 1.2};
101110```
111+
112+ #### Decode with specific parameter
113+ ``` javascript
114+ var url = ' www.myurl.com?appVersion=e2E6ICdRU00nLCB2ZXJzaW9uOiAxLjJ9' ;
115+ var ret = qsm .decode (url, ' appVersion' );
116+ // ret === {a: 'QSM', version: 1.2};
117+ ```
Original file line number Diff line number Diff line change 11{
22 "name" : " qsm" ,
3- "version" : " 1.2. 3" ,
3+ "version" : " 1.3" ,
44 "description" : " a simple tool that allows you to remove any querystring from the url" ,
55 "main" : " qsm.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments