tardis-client
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -95,2 +95,5 @@ "use strict"; | ||
let linesCount = 0; | ||
// date is always formatted to have lendth of 28 so we can skip looking for first space in line and use it | ||
// as hardcoded value | ||
const DATE_MESSAGE_SPLIT_INDEX = 28; | ||
for await (const line of linesStream) { | ||
@@ -101,5 +104,4 @@ const bufferLine = line; | ||
linesCount++; | ||
const splitIndex = bufferLine.indexOf(SPACE_BYTE); | ||
const localTimestampBuffer = bufferLine.slice(0, splitIndex); | ||
const messageBuffer = bufferLine.slice(splitIndex + 1); | ||
const localTimestampBuffer = bufferLine.slice(0, DATE_MESSAGE_SPLIT_INDEX); | ||
const messageBuffer = bufferLine.slice(DATE_MESSAGE_SPLIT_INDEX + 1); | ||
// as any due to https://github.com/Microsoft/TypeScript/issues/24929 | ||
@@ -106,0 +108,0 @@ if (decodeLine == true) { |
{ | ||
"name": "tardis-client", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"description": "Node.js client for tardis.dev - historical cryptocurrency market data replay API.", | ||
"description": "Node.js client for tardis.dev - historical tick-level cryptocurrency market data replay API.", | ||
"main": "dist/index.js", | ||
@@ -29,3 +29,6 @@ "source": "src/index.ts", | ||
"api client", | ||
"crypto markets data replay" | ||
"crypto markets data replay", | ||
"historical data", | ||
"historical cryptocurrency prices", | ||
"cryptocurrency api" | ||
], | ||
@@ -32,0 +35,0 @@ "license": "MPL-2.0", |
@@ -6,3 +6,3 @@ # tardis-client | ||
A Node.js client for [tardis.dev](https://tardis.dev) - historical tick-level cryptocurrency market data replay API. | ||
Node.js client for [tardis.dev](https://tardis.dev) - historical tick-level cryptocurrency market data replay API. | ||
@@ -9,0 +9,0 @@ Provides fast easy to use wrapper for more level [REST API](https://docs.tardis.dev/api#http-api) with local file based caching build in. |
@@ -131,2 +131,5 @@ import os from 'os' | ||
let linesCount = 0 | ||
// date is always formatted to have lendth of 28 so we can skip looking for first space in line and use it | ||
// as hardcoded value | ||
const DATE_MESSAGE_SPLIT_INDEX = 28 | ||
@@ -138,5 +141,4 @@ for await (const line of linesStream) { | ||
linesCount++ | ||
const splitIndex = bufferLine.indexOf(SPACE_BYTE) | ||
const localTimestampBuffer = bufferLine.slice(0, splitIndex) | ||
const messageBuffer = bufferLine.slice(splitIndex + 1) | ||
const localTimestampBuffer = bufferLine.slice(0, DATE_MESSAGE_SPLIT_INDEX) | ||
const messageBuffer = bufferLine.slice(DATE_MESSAGE_SPLIT_INDEX + 1) | ||
// as any due to https://github.com/Microsoft/TypeScript/issues/24929 | ||
@@ -143,0 +145,0 @@ if (decodeLine == true) { |
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
93622
1215