@applitools/eyes-sdk-core
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -12,2 +12,3 @@ 'use strict'; | ||
const { GeneralUtils } = require('../utils/GeneralUtils'); | ||
const { TypeUtils } = require('../utils/TypeUtils'); | ||
const { ArgumentGuard } = require('../ArgumentGuard'); | ||
@@ -296,8 +297,9 @@ | ||
* | ||
* @param {ProxySettings|string} arg1 The proxy setting or url to be used. If {@code null} then no proxy is set. | ||
* @param {ProxySettings|string|boolean} varArg The ProxySettings object or proxy url to be used. | ||
* Use {@code false} to disable proxy (even if it set via env variables). Use {@code null} to reset proxy settings. | ||
* @param {string} [username] | ||
* @param {string} [password] | ||
*/ | ||
setProxy(arg1, username, password) { | ||
if (!arg1) { | ||
setProxy(varArg, username, password) { | ||
if (TypeUtils.isNull(varArg)) { | ||
this._proxySettings = undefined; | ||
@@ -308,6 +310,12 @@ delete this._httpOptions.proxy; | ||
if (arg1 instanceof ProxySettings) { | ||
this._proxySettings = arg1; | ||
if (varArg === false) { | ||
this._proxySettings = undefined; | ||
this._httpOptions.proxy = false; | ||
return; | ||
} | ||
if (varArg instanceof ProxySettings) { | ||
this._proxySettings = varArg; | ||
} else { | ||
this._proxySettings = new ProxySettings(arg1, username, password); | ||
this._proxySettings = new ProxySettings(varArg, username, password); | ||
} | ||
@@ -314,0 +322,0 @@ |
@@ -12,2 +12,12 @@ 'use strict'; | ||
/** | ||
* Checks if `value` is `null` or `undefined`. But the `value` can be one of following: `0`, `NaN`, `false`, `""`. | ||
* | ||
* @param {*} value | ||
* @return {boolean} | ||
*/ | ||
static isNull(value) { | ||
return value == null; | ||
} | ||
/** | ||
* Checks if `value` has a type `string` or created by the `String` constructor | ||
@@ -14,0 +24,0 @@ * |
{ | ||
"name": "@applitools/eyes-sdk-core", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "The core components of Eyes JavaScript SDK", | ||
@@ -50,3 +50,4 @@ "keywords": [ | ||
"node": ">= 8.9.0" | ||
} | ||
}, | ||
"gitHead": "7c8731cee53d073f25830ddf9a0c9971c09d807b" | ||
} |
Sorry, the diff of this file is too big to display
442315
122
12765