text: import lang from 'dojo/_base/lang'
  
  class io {
  
      queryToObject (str) {
          var dec = decodeURIComponent
          var qp = str.split("&")
          var ret = {}
          var name
          var val
          for(var i = 0, l = qp.length, item; i < l; ++i){
              item = qp[i];
              if(item.length){
                  var s = item.indexOf("=");
                  if(s < 0){
                      name = dec(item);
                      val = "";
                  }else{
                      name = dec(item.slice(0, s));
                      val  = dec(item.slice(s + 1));
                  }
                  if(typeof ret[name] == "string"){ // inline'd type check
                      ret[name] = [ret[name]];
                  }
  
                  if(lang.isArray(ret[name])){
                      ret[name].push(val);
                  }else{
                      ret[name] = val;
                  }
              }
          }
          return ret; // Object
      }
  }
  export default new io()