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 CondStream = cl.load( "botanss.utils.CondStream" );
|
||||
var querystr = require( "querystring" );
|
||||
|
||||
module.exports = {
|
||||
queryStr: function( qstr )
|
||||
{
|
||||
var qObj = {};
|
||||
|
||||
if( qstr instanceof CondStream ) qstr = qstr.toString();
|
||||
|
||||
qstr.split( "&" ).forEach( function( val )
|
||||
{
|
||||
val = val.split( "=" );
|
||||
qObj[ val[0] ] = val[1] ? decodeURIComponent( val[1].replace( /\+/g, " " ) ) : "";
|
||||
} );
|
||||
|
||||
return qObj;
|
||||
return querystr.parse( qstr );
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user