v3.9.0: feat() upgrade to node lts, feat() upgrade axios, jest and other dependencies, chore(): move some dependencies to optional

This commit is contained in:
tiagosiebler
2024-01-25 14:42:39 +00:00
parent 0c872173c0
commit 7fcf4b0bf4
14 changed files with 4013 additions and 4834 deletions

View File

@@ -1,3 +1,4 @@
import { AxiosResponse } from 'axios';
import { APIRateLimit } from '../types';
import { WebsocketSucceededTopicSubscriptionConfirmationEvent } from '../types/ws-events/succeeded-topic-subscription-confirmation';
import { WebsocketTopicSubscriptionConfirmationEvent } from '../types/ws-events/topic-subscription-confirmation';
@@ -179,10 +180,13 @@ export type RestClientType =
/** Parse V5 rate limit response headers, if enabled */
export function parseRateLimitHeaders(
headers: Record<string, string | undefined> = {},
headers: AxiosResponse['headers'] | undefined,
throwOnFailedRateLimitParse: boolean,
): APIRateLimit | undefined {
try {
if (!headers || typeof headers !== 'object') {
return;
}
const remaining = headers['x-bapi-limit-status'];
const max = headers['x-bapi-limit'];
const resetAt = headers['x-bapi-limit-reset-timestamp'];