Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

Commit c07456e

Browse files
committed
Fixed lint errors
1 parent 29901cb commit c07456e

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

lib/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export * from './types'
3737
/**
3838
* Create a trading stream, which uses supplied feeds as sources, and outputs feed events as well as
3939
* events produced by the supplied strategy.
40-
*
40+
*
4141
* @param {any} settings An object containing settings.
4242
* @param {Strategy} strategy A Strategy function.
4343
* @returns {Stream}
@@ -93,7 +93,7 @@ export function createTrader(settings: any, strategy: Strategy) {
9393

9494
// Consumers
9595
const createConsumer = createConsumerCreator(store)
96-
96+
9797
const reducerMiddleware: Middleware = store => next => (action) => {
9898
reducing = true
9999
store.setState(rootReducer(store.getState(), action))
@@ -192,13 +192,12 @@ export function createTrader(settings: any, strategy: Strategy) {
192192
action
193193
}))
194194

195-
196195
if (config.dashboard.active) {
197196
const app = http.createServer()
198197
const io = socket(app, {
199198
pingTimeout: 1000,
200199
pingInterval: 400,
201-
origins: /* istanbul ignore next: must be manually tested for now */
200+
origins: /* istanbul ignore next: must be manually tested for now */
202201
process.env.NODE_ENV === 'test' ? '*:*' : 'devalpha.io:*'
203202
})
204203

lib/reducers/capitalReducer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function capitalReducer(
4040
}
4141
if (action.payload.initialStates.capital) {
4242
const initial = action.payload.initialStates.capital
43-
43+
4444
if (typeof initial.cash !== 'undefined') {
4545
state.cash = new Decimal(initial.cash)
4646
}
@@ -116,7 +116,7 @@ export function capitalReducer(
116116
/* we might get filled at a higher price than expected, and thus pay higher commission */
117117
/* extraCommission = max(0, (commission - expectedCommission) * quantity) */
118118
const extraCommission = Decimal.max(
119-
0,
119+
0,
120120
Decimal.sub(filledOrder.commission, placedOrder.commission).mul(filledOrder.commission)
121121
)
122122

lib/reducers/positionsReducer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function positionsReducer(state: PositionsState = initialState, action: S
104104
/* update value */
105105
/* value = order.price * (instrument.quantity + order.quantity) */
106106
const value = Decimal.mul(filledOrder.price, Decimal.add(instrument.quantity, filledOrder.quantity))
107-
107+
108108
const oldValue = instrument.value
109109

110110
instrument = { ...instrument, quantity, value }
@@ -119,7 +119,7 @@ export function positionsReducer(state: PositionsState = initialState, action: S
119119
state.instruments[identifier] = instrument
120120

121121
state.total = Decimal.add(state.total, Decimal.sub(value, oldValue))
122-
122+
123123
break
124124
}
125125

@@ -148,6 +148,6 @@ export function positionsReducer(state: PositionsState = initialState, action: S
148148
break
149149
}
150150
}
151-
151+
152152
return { ...state }
153153
}

lib/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export type Middleware = (store: Store) => (next: Function) => (action: StreamAc
101101

102102
export type Consumer = (err: Error, item: StreamAction | Highland.Nil, push: Function, next: Function) => void
103103

104-
105104
export interface Order {
106105
identifier: string
107106
}

lib/util/orders.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export const createOrder = (store: Store) => (calculateCommission: Function) =>
3939
} else {
4040
createdOrder.identifier = order.identifier
4141
}
42-
42+
4343
if (typeof order.price === 'undefined') {
4444
throw new Error('market orders not yet supported')
4545
} else {
4646
createdOrder.price = new Decimal(order.price)
4747
}
48-
48+
4949
if (typeof order.quantity !== 'undefined' && typeof order.percent === 'undefined') {
5050
createdOrder.quantity = new Decimal(order.quantity)
5151
} else if (typeof order.quantity === 'undefined' && typeof order.percent !== 'undefined') {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy