tardis-dev
Advanced tools
Comparing version 10.1.6 to 10.1.7
@@ -23,2 +23,13 @@ "use strict"; | ||
} | ||
function getSymbols(symbols) { | ||
if (symbols === undefined) { | ||
return; | ||
} | ||
return symbols.map((symbol) => { | ||
if (symbol.startsWith('S')) { | ||
return symbol.charAt(0).toLowerCase() + symbol.slice(1); | ||
} | ||
return symbol; | ||
}); | ||
} | ||
exports.phemexTradesMapper = { | ||
@@ -32,3 +43,3 @@ canHandle(message) { | ||
channel: 'trades', | ||
symbols | ||
symbols: getSymbols(symbols) | ||
} | ||
@@ -42,3 +53,3 @@ ]; | ||
type: 'trade', | ||
symbol, | ||
symbol: symbol.toUpperCase(), | ||
exchange: 'phemex', | ||
@@ -69,3 +80,3 @@ id: undefined, | ||
channel: 'book', | ||
symbols | ||
symbols: getSymbols(symbols) | ||
} | ||
@@ -79,3 +90,3 @@ ]; | ||
type: 'book_change', | ||
symbol: message.symbol, | ||
symbol: symbol.toUpperCase(), | ||
exchange: 'phemex', | ||
@@ -82,0 +93,0 @@ isSnapshot: message.type === 'snapshot', |
@@ -20,5 +20,2 @@ "use strict"; | ||
return filter.symbols.map((symbol) => { | ||
if (symbol.startsWith('S')) { | ||
symbol = symbol.charAt(0).toLocaleLowerCase() + symbol.slice(1); | ||
} | ||
return { | ||
@@ -25,0 +22,0 @@ id: id++, |
{ | ||
"name": "tardis-dev", | ||
"version": "10.1.6", | ||
"version": "10.1.7", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=12" |
@@ -30,2 +30,14 @@ import { Mapper, PendingTickerInfoHelper } from './mapper' | ||
function getSymbols(symbols?: string[]) { | ||
if (symbols === undefined) { | ||
return | ||
} | ||
return symbols.map((symbol) => { | ||
if (symbol.startsWith('S')) { | ||
return symbol.charAt(0).toLowerCase() + symbol.slice(1) | ||
} | ||
return symbol | ||
}) | ||
} | ||
export const phemexTradesMapper: Mapper<'phemex', Trade> = { | ||
@@ -40,3 +52,3 @@ canHandle(message: PhemexTradeMessage) { | ||
channel: 'trades', | ||
symbols | ||
symbols: getSymbols(symbols) | ||
} as const | ||
@@ -52,3 +64,3 @@ ] | ||
type: 'trade', | ||
symbol, | ||
symbol: symbol.toUpperCase(), | ||
exchange: 'phemex', | ||
@@ -82,3 +94,3 @@ id: undefined, | ||
channel: 'book', | ||
symbols | ||
symbols: getSymbols(symbols) | ||
} as const | ||
@@ -93,3 +105,3 @@ ] | ||
type: 'book_change', | ||
symbol: message.symbol, | ||
symbol: symbol.toUpperCase(), | ||
exchange: 'phemex', | ||
@@ -96,0 +108,0 @@ isSnapshot: message.type === 'snapshot', |
@@ -18,6 +18,2 @@ import { Filter } from '../types' | ||
return filter.symbols.map((symbol) => { | ||
if (symbol.startsWith('S')) { | ||
symbol = symbol.charAt(0).toLocaleLowerCase() + symbol.slice(1) | ||
} | ||
return { | ||
@@ -24,0 +20,0 @@ id: id++, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
702987
12440
30