diff --git a/querystr.js b/querystr.js index 24d1699..5f5208b 100644 --- a/querystr.js +++ b/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 ); } };