@barchart/common-js
Advanced tools
Comparing version 3.0.20 to 3.0.22
@@ -268,2 +268,26 @@ const assert = require('./assert'), | ||
/** | ||
* Runs {@link Decimal#getIsZero} and returns the result. | ||
* | ||
* @public | ||
* @param {Decimal} instance | ||
*/ | ||
static getIsZero(instance) { | ||
assert.argumentIsRequired(instance, 'instance', Decimal, 'Decimal'); | ||
return instance.getIsZero(); | ||
} | ||
/** | ||
* Runs {@link Decimal#getIsZero} and returns the inverse. | ||
* | ||
* @public | ||
* @param {Decimal} instance | ||
*/ | ||
static getIsNotZero(instance) { | ||
assert.argumentIsRequired(instance, 'instance', Decimal, 'Decimal'); | ||
return !instance.getIsZero(); | ||
} | ||
/** | ||
* Runs {@link Decimal#getIsPositive} and returns the result. | ||
@@ -270,0 +294,0 @@ * |
@@ -23,3 +23,3 @@ const http = require('http'), | ||
_call(endpoint, data, host, port, secure) { | ||
_call(endpoint, data, host, port, secure, token) { | ||
return promise.build((resolveCallback, rejectCallback) => { | ||
@@ -46,3 +46,3 @@ let connector; | ||
const options = { | ||
let options = { | ||
method: action.getHttpVerb(), | ||
@@ -57,2 +57,6 @@ hostname: host, | ||
if (token) { | ||
options.headers['Authorization'] = token; | ||
} | ||
const request = connector.request(options, (response) => { | ||
@@ -59,0 +63,0 @@ response.setEncoding('utf8'); |
@@ -37,3 +37,3 @@ const assert = require('./../../lang/assert'); | ||
*/ | ||
call(endpoint, data) { | ||
call(endpoint, data, token) { | ||
return Promise.resolve() | ||
@@ -43,3 +43,3 @@ .then(() => { | ||
return this._call(endpoint, data, this._host, this._port, this._secure); | ||
return this._call(endpoint, data, this._host, this._port, this._secure, token); | ||
}); | ||
@@ -46,0 +46,0 @@ } |
{ | ||
"name": "@barchart/common-js", | ||
"version": "3.0.20", | ||
"version": "3.0.22", | ||
"description": "Library of common javascript utilities", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
2626870
58542