@icgio/icg-utils 1.9.45 → 1.9.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils.js +4 -2
- package/package.json +1 -1
package/lib/utils.js
CHANGED
|
@@ -260,7 +260,7 @@ function cut_orderbook(input_array, level_target) {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
function level_position(input_array, level_target) {
|
|
263
|
-
if (input_array.length
|
|
263
|
+
if (input_array.length < level_target) {
|
|
264
264
|
level_target--
|
|
265
265
|
return level_position(input_array, level_target)
|
|
266
266
|
}
|
|
@@ -837,7 +837,9 @@ function number_with_commas(x) {
|
|
|
837
837
|
const EXCHANGE_ACCOUNT_KEY_RE = /^([a-z0-9]+)_(\d+)$/
|
|
838
838
|
|
|
839
839
|
function normalize_exchange_key(exchange) {
|
|
840
|
-
return String(exchange || '')
|
|
840
|
+
return String(exchange || '')
|
|
841
|
+
.trim()
|
|
842
|
+
.toLowerCase()
|
|
841
843
|
}
|
|
842
844
|
|
|
843
845
|
function is_exchange_account_key(exchange) {
|