Skip to content

Commit

Permalink
Fix undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
kami4ka committed Aug 24, 2021
1 parent 0a2a09f commit 8364a64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrapingant/scrapingant-client",
"version": "0.0.2",
"version": "0.0.3",
"description": "ScrapingAnt API client for JavaScript",
"main": "src/index.js",
"keywords": [
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ class ScrapingAntClient {
*
* @param {string} url
* @param {object} [parameters]
* @param {string} [parameters.browser]
* @param {string} [parameters.cookies]
* @param {string} [parameters.js_snippet]
* @param {string} [parameters.proxy_country]
* @param {string} [parameters.wait_for_selector]
* @param {boolean} [parameters.return_text]
*/
scrape(url, parameters) {
Expand Down
2 changes: 1 addition & 1 deletion src/scraping_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ScrapingClient {
},
data: {
url,
...(parameters.browser && { browser: !!parameters.browser }),
...(typeof parameters.browser !== 'undefined' && { browser: !!parameters.browser }),
...(parameters.cookies && { cookies: parameters.cookies }),
...(parameters.js_snippet && { js_snippet: base64encode(parameters.js_snippet) }),
...(parameters.proxy_country && { proxy_country: parameters.proxy_country }),
Expand Down

0 comments on commit 8364a64

Please sign in to comment.