tardis-dev 12.7.7 → 13.1.0

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/src/stream.ts CHANGED
@@ -61,12 +61,6 @@ async function* _streamNormalized<T extends Exchange, U extends MapperFactory<T,
61
61
  ? X
62
62
  : never
63
63
  > {
64
- // mappers assume that symbols are uppercased by default
65
- // if user by mistake provide lowercase one let's automatically fix it
66
- if (symbols !== undefined) {
67
- symbols = symbols.map((s) => s.toUpperCase())
68
- }
69
-
70
64
  while (true) {
71
65
  try {
72
66
  const createMappers = (localTimestamp: Date) => normalizers.map((m) => m(exchange, localTimestamp))
@@ -83,8 +77,10 @@ async function* _streamNormalized<T extends Exchange, U extends MapperFactory<T,
83
77
 
84
78
  // filter normalized messages by symbol as some exchanges do not offer subscribing to specific symbols for some of the channels
85
79
  // for example Phemex market24h channel
80
+
81
+ const upperCaseSymbols = symbols !== undefined ? symbols.map((s) => s.toUpperCase()) : undefined
86
82
  const filter = (symbol: string) => {
87
- return symbols === undefined || symbols.length === 0 || symbols.includes(symbol)
83
+ return upperCaseSymbols === undefined || upperCaseSymbols.length === 0 || upperCaseSymbols.includes(symbol)
88
84
  }
89
85
 
90
86
  const normalizedMessages = normalizeMessages(exchange, messages, mappers, createMappers, withDisconnectMessages, filter, new Date())