using the native api

This commit is contained in:
斟酌 鵬兄 2016-06-16 15:30:40 +08:00
parent 0ae868ac2d
commit 4a76826516

View File

@ -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 );
}
};