Skip to content

Commit

Permalink
Fixed pre-publish script, Fixed #40
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed May 2, 2018
1 parent b269ff6 commit 2b93e49
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 218 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// * Author: [@niftylettuce](https://twitter.com/#!/niftylettuce)
// * Source: <https://github.com/niftylettuce/express-paginate>

var querystring = require('querystring');
var qs = require('qs');
var url = require('url');
var assign = require('lodash.assign');
var clone = require('lodash.clone');
Expand Down Expand Up @@ -39,7 +39,7 @@ exports.href = function href(req) {
if (isObject(params))
query = assign(query, params);

return url.parse(req.originalUrl).pathname + '?' + querystring.stringify(query);
return url.parse(req.originalUrl).pathname + '?' + qs.stringify(query);

};
};
Expand Down Expand Up @@ -72,7 +72,7 @@ exports.getArrayPages = function(req) {
if (limit > 0) {
var end = Math.min(Math.max(currentPage + Math.floor(limit / 2), limit), pageCount);
var start = Math.max(1, (currentPage < (limit - 1)) ? 1 : (end - limit) + 1);

var pages = [];
for (var i = start; i <= end; i++) {
pages.push({
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@
"lodash.assign": "^4.2.0",
"lodash.clone": "^4.5.0",
"lodash.isobject": "^3.0.2",
"querystring": "^0.2.0"
"qs": "^6.5.1"
},
"devDependencies": {
"async": "^2.5.0",
"chai": "^4.1.0",
"istanbul": "^0.4.5",
"mocha": "^3.4.2",
"reqres": "^1.2.2"
"mocha": "^5.1.1",
"reqres": "^2.1.0"
},
"scripts": {
"prepublish": "npm prune",
"test": "mocha --reporter spec --bail --check-leaks --require test/support/should test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks --require test/support/should test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks --require test/support/should test/"
"test": "node_modules/.bin/mocha --reporter spec --bail --check-leaks --require test/support/should test/",
"test-cov": "istanbul cover node_modules/.bin/mocha -- --reporter dot --check-leaks --require test/support/should test/",
"test-travis": "istanbul cover node_modules/.bin/mocha --report lcovonly -- --reporter spec --check-leaks --require test/support/should test/"
}
}
Loading

0 comments on commit 2b93e49

Please sign in to comment.