code: function (params) {
          this.query = params.q !== undefined ? String(params.q) : defaultParams.query;
          this.page = params.p !== undefined ? parseInt(params.p, 10) : defaultParams.page;
          switch (params.s) {
            case 'name':
            case 'owner':
            case 'stars':
            case 'updated':
              this.sorting = params.s;
              break;
            default:
              this.sorting = defaultParams.sorting;
          }
          switch (params.o) {
            case 'asc':
            case 'desc':
              this.order = params.o;
              break;
            default:
              this.order = defaultParams.order;
          }
        }
docs: Parse params to set correct value