Skip to content

Commit

Permalink
remove duplicated driver fn
Browse files Browse the repository at this point in the history
  • Loading branch information
joaobarbosa committed Mar 11, 2020
1 parent ff7a130 commit 2841e76
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.0.5 / 2020-03-11
==================

- removed duplicated function (crawler#driver(fn))

2.0.4 / 2019-02-22
==================

Expand Down
21 changes: 4 additions & 17 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var debug = require('debug')('x-ray-crawler')
*/

function Crawler(driver) {
driver = driver || http();
driver = driver || http()

// defaults
var throttle = rate_limit()
Expand Down Expand Up @@ -139,9 +139,9 @@ function Crawler(driver) {
*/

crawler.driver = function(fn) {
if (!arguments.length) return driver;
driver = fn;
return crawler;
if (!arguments.length) return driver
driver = fn
return crawler
}

/**
Expand Down Expand Up @@ -198,19 +198,6 @@ function Crawler(driver) {
return crawler
}

/**
* Specify the driver
*
* @param {Function} driver
* @return {Function|Crawler}
*/

crawler.driver = function(fn) {
if (!arguments.length) return driver
driver = fn
return crawler
}

/**
* Specify a request concurrency
*
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "x-ray-crawler",
"version": "2.0.4",
"version": "2.0.5",
"description": "x-ray's crawler",
"main": "lib/index.js",
"dependencies": {
Expand Down

0 comments on commit 2841e76

Please sign in to comment.