protoblast
Advanced tools
Comparing version 0.8.1 to 0.8.2
@@ -0,1 +1,7 @@ | ||
## 0.8.2 (2023-01-24) | ||
* Throw an error when the value passed to `Date.parseStringToTime()` is not a string or a number | ||
* Add `HttpAgent`, `HttpsAgent` and `AgentPool` class and use them for making keep-alive requests | ||
* Add the `SampleCollector` class, which can be used to create rolling averages | ||
## 0.8.1 (2023-01-23) | ||
@@ -2,0 +8,0 @@ |
@@ -209,3 +209,3 @@ const defStat = Blast.createStaticDefiner('Date'), | ||
* @since 0.5.7 | ||
* @version 0.6.4 | ||
* @version 0.8.2 | ||
* | ||
@@ -219,13 +219,2 @@ * @param {String} str The input string | ||
var unit_time, | ||
base_date, | ||
result, | ||
entry, | ||
type, | ||
name, | ||
unit, | ||
val, | ||
add, | ||
d; | ||
if (typeof str == 'string') { | ||
@@ -251,6 +240,22 @@ if (rx_dmy.test(str) || rx_ymd.test(str)) { | ||
if (Number(str)) { | ||
return Number(str) + base; | ||
let nr = Number(str); | ||
if (isFinite(nr)) { | ||
return nr + base; | ||
} | ||
if (typeof str != 'string') { | ||
throw new TypeError('Value is not a string or number'); | ||
} | ||
let base_date, | ||
result, | ||
entry, | ||
type, | ||
name, | ||
unit, | ||
val, | ||
add, | ||
d; | ||
// Lowercase the string | ||
@@ -257,0 +262,0 @@ str = str.toLowerCase(); |
@@ -439,2 +439,3 @@ module.exports = function BlastInitLoader(modifyPrototype) { | ||
'RegExp', | ||
'SampleCollector', | ||
'String', | ||
@@ -1572,2 +1573,3 @@ 'StringBuilder', | ||
if (Blast.isNode) { | ||
Blast.require('request_agents', {add_wrapper: true, client: false}); | ||
Blast.require('request_server', {add_wrapper: true, client: false}); | ||
@@ -1574,0 +1576,0 @@ Blast.require('stream_delayed', {client: false}); |
@@ -176,5 +176,5 @@ var dns_cache, | ||
* | ||
* @author Jelle De Loecker <jelle@develry.be> | ||
* @author Jelle De Loecker <jelle@elevenways.be> | ||
* @since 0.2.0 | ||
* @version 0.7.22 | ||
* @version 0.8.2 | ||
*/ | ||
@@ -206,2 +206,4 @@ Request.setMethod(function _make_request(options) { | ||
const is_https = url.protocol == 'https:'; | ||
config = { | ||
@@ -214,5 +216,33 @@ host : url.hostname, | ||
lookup : dns ? Request.lookup : undefined, | ||
rejectUnauthorized : this.rejectUnauthorized, | ||
}; | ||
if (url.protocol == 'https:') { | ||
let agent_pool = this.agent_pool, | ||
agent = this.agent; | ||
if (typeof agent == 'string') { | ||
agent_pool = agent; | ||
agent = null; | ||
} | ||
if (!agent) { | ||
if (agent_pool !== false) { | ||
agent_pool = Classes.Develry.AgentPool.get(this.agent_pool); | ||
} | ||
if (agent_pool) { | ||
if (is_https) { | ||
agent = agent_pool.https_agent; | ||
} else { | ||
agent = agent_pool.http_agent; | ||
} | ||
} | ||
} | ||
if (agent) { | ||
config.agent = agent; | ||
} | ||
if (is_https) { | ||
protocol = https; | ||
@@ -219,0 +249,0 @@ } else { |
@@ -330,8 +330,2 @@ const ORIGINAL_REQUEST = Symbol('ori_req'), | ||
var set_method, | ||
info, | ||
body, | ||
get, | ||
key; | ||
if (!options) { | ||
@@ -347,2 +341,7 @@ return; | ||
let set_method, | ||
info, | ||
body, | ||
key; | ||
for (key in options) { | ||
@@ -349,0 +348,0 @@ |
{ | ||
"name": "protoblast", | ||
"description": "Native object expansion library", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"author": "Jelle De Loecker <jelle@elevenways.be>", | ||
@@ -39,3 +39,4 @@ "keywords": [ | ||
"uglify-js" : "3.2.0", | ||
"wd" : "~1.12.1" | ||
"wd" : "~1.12.1", | ||
"mm" : "~3.2.1" | ||
}, | ||
@@ -42,0 +43,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
780529
60
32312
14
6