Skip to content

Commit c8f4ab6

Browse files
committed
Merge branch 'develop' of https://github.com/cryptomkt/cryptomkt-node into develop
2 parents 53a0451 + 8e53b88 commit c8f4ab6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/Socket.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ class Socket {
342342
const result = {};
343343
result[stockId] = this.candlesData[stockId].data;
344344

345-
const cleanResult = _.mapValues(result, (obj) => {
345+
const cloneResult = this._deepClone(result);
346+
347+
const cleanResult = _.mapValues(cloneResult, (obj) => {
346348
if (_.has(obj, '1')) {
347349
obj.buy = obj['1'];
348350
delete obj['1'];
@@ -356,7 +358,7 @@ class Socket {
356358
return obj;
357359
});
358360

359-
this.eventBus.emit('candles', null, this._deepClone(cleanResult));
361+
this.eventBus.emit('candles', null, cleanResult);
360362
});
361363

362364
this.socketClient.on('candles-delta', (delta) => {
@@ -383,7 +385,9 @@ class Socket {
383385
const result = {};
384386
result[stockId] = this.candlesData[stockId].data;
385387

386-
const cleanResult = _.mapValues(result, (obj) => {
388+
const cloneResult = this._deepClone(result);
389+
390+
const cleanResult = _.mapValues(cloneResult, (obj) => {
387391
if (_.has(obj, '1')) {
388392
obj.buy = obj['1'];
389393
delete obj['1'];
@@ -397,7 +401,7 @@ class Socket {
397401
return obj;
398402
});
399403

400-
this.eventBus.emit('candles', null, this._deepClone(cleanResult));
404+
this.eventBus.emit('candles', null, cleanResult);
401405
} else {
402406
this.socketClient.emit('candles', {
403407
stockId: delta.stock_id,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cryptomarket",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "The CryptoMarket for Node.js",
55
"homepage": "https://www.cryptomkt.com",
66
"main": "./index.js",

0 commit comments

Comments
 (0)