using the native api
This commit is contained in:
parent
0ae868ac2d
commit
4a76826516
12
querystr.js
12
querystr.js
@ -1,19 +1,11 @@
|
|||||||
var cl = global.botanLoader;
|
var cl = global.botanLoader;
|
||||||
var CondStream = cl.load( "botanss.utils.CondStream" );
|
var CondStream = cl.load( "botanss.utils.CondStream" );
|
||||||
|
var querystr = require( "querystring" );
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
queryStr: function( qstr )
|
queryStr: function( qstr )
|
||||||
{
|
{
|
||||||
var qObj = {};
|
|
||||||
|
|
||||||
if( qstr instanceof CondStream ) qstr = qstr.toString();
|
if( qstr instanceof CondStream ) qstr = qstr.toString();
|
||||||
|
return querystr.parse( qstr );
|
||||||
qstr.split( "&" ).forEach( function( val )
|
|
||||||
{
|
|
||||||
val = val.split( "=" );
|
|
||||||
qObj[ val[0] ] = val[1] ? decodeURIComponent( val[1].replace( /\+/g, " " ) ) : "";
|
|
||||||
} );
|
|
||||||
|
|
||||||
return qObj;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user