Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasrafael committed Aug 7, 2019
2 parents 25bdf4b + afdf427 commit 40e2f0f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ declare namespace queryStringsParser {
export interface QueryStringsParser {
(options?: IOptions): any

parser(query?: string | object, options?: IOptions): any

parseFields(query?: string | object, options?: IOptions): any

parseSort(query?: string | object, options?: IOptions): any
Expand Down Expand Up @@ -40,4 +42,4 @@ declare namespace queryStringsParser {
start_at?: string
end_at?: string
}
}
}
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ exports = module.exports = function (params) {
return read.parser(params)
}

exports = module.exports.parser = function (query, defaults) {
return read.parseAll(query, defaults)
exports = module.exports.parser = function (query, _default, _options) {
return read.parseAll(query, _default, _options)
}

exports = module.exports.parseFields = function (_query, _default) {
Expand Down
11 changes: 6 additions & 5 deletions lib/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ function validate_options(params) {
return options
}

exports = module.exports.parseAll = function (_query, _default) {
exports = module.exports.parseAll = function (_query, _default, _options) {
const options = validate_options({'default': _default, ..._options})
return {
fields: this.parseFields(_query, _default),
sort: this.parseSort(_query),
filters: this.parseFilter(_query, _default),
pagination: this.parsePagination(_query, _default, true),
fields: fields.fields(stringToJson(_query), options),
sort: ordination.sort(stringToJson(_query), options),
filters: filters.filters(stringToJson(_query), options),
pagination: pagination.pagination(stringToJson(_query), options),
original: _query
}
}
Expand Down

0 comments on commit 40e2f0f

Please sign in to comment.