@icgio/icg-utils 1.9.14 → 1.9.15

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.
Files changed (2) hide show
  1. package/lib/utils.js +25 -0
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -846,11 +846,36 @@ module.exports.exchange_cur_quote_cur_converter = (exchange_cur_quote_cur) => {
846
846
  pair_exchanges[pair].push(exchange)
847
847
  })
848
848
  }
849
+ // Add exchange_pairs_without_2
850
+ let exchange_pairs_without_2 = {}
851
+ for (let exchange in exchange_pairs) {
852
+ if (!exchange.endsWith('_2')) {
853
+ exchange_pairs_without_2[exchange] = exchange_pairs[exchange]
854
+ }
855
+ }
856
+ // Add exchange_curs_without_2
857
+ let exchange_curs_without_2 = {}
858
+ for (let exchange in exchange_curs) {
859
+ if (!exchange.endsWith('_2')) {
860
+ exchange_curs_without_2[exchange] = exchange_curs[exchange]
861
+ }
862
+ }
863
+ // Add pair_exchanges_without_2
864
+ let pair_exchanges_without_2 = {}
865
+ for (let pair in pair_exchanges) {
866
+ pair_exchanges_without_2[pair] = pair_exchanges[pair].filter((exchange) => !exchange.endsWith('_2'))
867
+ if (pair_exchanges_without_2[pair].length === 0) {
868
+ delete pair_exchanges_without_2[pair]
869
+ }
870
+ }
849
871
  return {
850
872
  exchange_cur_quote_cur,
851
873
  exchange_pairs,
874
+ exchange_pairs_without_2,
852
875
  exchange_curs,
876
+ exchange_curs_without_2,
853
877
  pair_exchanges,
878
+ pair_exchanges_without_2,
854
879
  }
855
880
  }
856
881
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.9.14",
3
+ "version": "1.9.15",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {