client/assets/scripts/services/search.js
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;
        }
      }
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;
        }
      }
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 ; } }
Parse params to set correct value
Parse params to set correct value