New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

portkey-ai

Package Overview
Dependencies
Maintainers
0
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

portkey-ai - npm Package Compare versions

Comparing version 1.6.2 to 1.6.3

dist/src/core.d.ts

2

dist/package.json
{
"name": "portkey-ai",
"version": "1.6.2",
"version": "1.6.3",
"description": "Node client library for the Portkey API",

@@ -5,0 +5,0 @@ "types": "./src/index.d.ts",

@@ -35,2 +35,3 @@ export type Headers = Record<string, string | null | undefined>;

mistralFimCompletion?: string | null | undefined;
dangerouslyAllowBrowser?: boolean | null | undefined;
[key: string]: any;

@@ -37,0 +38,0 @@ }

@@ -36,2 +36,3 @@ export type Headers = Record<string, string | null | undefined>;

mistralFimCompletion?: string | null | undefined;
dangerouslyAllowBrowser?: boolean | null | undefined;
[key: string]: any;

@@ -38,0 +39,0 @@ }

@@ -45,3 +45,3 @@ /// <reference types="node" />

private fetch;
constructor({ apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, ...rest }: ApiClientInterface);
constructor({ apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, dangerouslyAllowBrowser, ...rest }: ApiClientInterface);
protected defaultHeaders(): Record<string, string>;

@@ -48,0 +48,0 @@ _post<Rsp extends APIResponseType>(path: string, opts?: RequestOptions): APIPromise<Rsp>;

@@ -34,3 +34,2 @@ "use strict";

const version_1 = require("./version.js");
fetch;
const defaultHttpAgent = new agentkeepalive_1.default({

@@ -40,2 +39,14 @@ keepAlive: true,

});
function getFetch() {
if (typeof window !== 'undefined' && window.fetch) {
return window.fetch.bind(window);
}
if (typeof global !== 'undefined' && global.fetch) {
return global.fetch;
}
if (typeof fetch !== 'undefined') {
return fetch;
}
throw new Error('Fetch is not available in this environment');
}
function defaultParseResponse(props) {

@@ -96,3 +107,3 @@ return __awaiter(this, void 0, void 0, function* () {

constructor(_a) {
var { apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance = false, anthropicBeta, anthropicVersion, mistralFimCompletion } = _a, rest = __rest(_a, ["apiKey", "baseURL", "config", "virtualKey", "traceID", "metadata", "provider", "Authorization", "cacheForceRefresh", "debug", "customHost", "openaiProject", "openaiOrganization", "awsSecretAccessKey", "awsAccessKeyId", "awsSessionToken", "awsRegion", "vertexProjectId", "vertexRegion", "workersAiAccountId", "azureResourceName", "azureDeploymentId", "azureApiVersion", "azureEndpointName", "huggingfaceBaseUrl", "forwardHeaders", "cacheNamespace", "requestTimeout", "strictOpenAiCompliance", "anthropicBeta", "anthropicVersion", "mistralFimCompletion"]);
var { apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance = false, anthropicBeta, anthropicVersion, mistralFimCompletion, dangerouslyAllowBrowser } = _a, rest = __rest(_a, ["apiKey", "baseURL", "config", "virtualKey", "traceID", "metadata", "provider", "Authorization", "cacheForceRefresh", "debug", "customHost", "openaiProject", "openaiOrganization", "awsSecretAccessKey", "awsAccessKeyId", "awsSessionToken", "awsRegion", "vertexProjectId", "vertexRegion", "workersAiAccountId", "azureResourceName", "azureDeploymentId", "azureApiVersion", "azureEndpointName", "huggingfaceBaseUrl", "forwardHeaders", "cacheNamespace", "requestTimeout", "strictOpenAiCompliance", "anthropicBeta", "anthropicVersion", "mistralFimCompletion", "dangerouslyAllowBrowser"]);
this.maxRetries = 1;

@@ -131,5 +142,6 @@ this.apiKey = apiKey !== null && apiKey !== void 0 ? apiKey : '';

mistralFimCompletion,
anthropicBeta }, rest));
anthropicBeta,
dangerouslyAllowBrowser }, rest));
this.portkeyHeaders = this.defaultHeaders();
this.fetch = fetch;
this.fetch = getFetch();
this.responseHeaders = {};

@@ -208,10 +220,7 @@ }

const reqHeaders = Object.assign(Object.assign({}, this.defaultHeaders()), this.customHeaders);
const httpAgent = defaultHttpAgent;
let req;
if (method === 'get') {
req = Object.assign({ method, headers: reqHeaders }, (httpAgent && { agent: httpAgent }));
const agentConfig = typeof window === 'undefined' ? { agent: defaultHttpAgent } : {};
const req = Object.assign({ method, headers: reqHeaders }, agentConfig);
if (method !== 'get' && body !== undefined) {
req.body = JSON.stringify((0, utils_1.parseBody)(body));
}
else {
req = Object.assign({ method, body: JSON.stringify((0, utils_1.parseBody)(body)), headers: reqHeaders }, (httpAgent && { agent: httpAgent }));
}
return { req: req, url: url.toString() };

@@ -218,0 +227,0 @@ }

@@ -19,3 +19,2 @@ import KeepAliveAgent from 'agentkeepalive';

import { VERSION } from './version';
fetch;
const defaultHttpAgent: Agent = new KeepAliveAgent({

@@ -25,2 +24,16 @@ keepAlive: true,

});
function getFetch(): Fetch {
if (typeof window !== 'undefined' && window.fetch) {
return window.fetch.bind(window);
}
if (typeof global !== 'undefined' && global.fetch) {
return global.fetch;
}
if (typeof fetch !== 'undefined') {
return fetch;
}
throw new Error('Fetch is not available in this environment');
}
export type Fetch = (url: string, init?: RequestInit) => Promise<Response>;

@@ -178,2 +191,3 @@

mistralFimCompletion,
dangerouslyAllowBrowser,
...rest

@@ -215,6 +229,7 @@ }: ApiClientInterface) {

anthropicBeta,
dangerouslyAllowBrowser,
...rest,
});
this.portkeyHeaders = this.defaultHeaders();
this.fetch = fetch;
this.fetch = getFetch();
this.responseHeaders = {};

@@ -337,17 +352,14 @@ }

};
const httpAgent: Agent | undefined = defaultHttpAgent;
let req: RequestInit;
if (method === 'get') {
req = {
method,
headers: reqHeaders,
...(httpAgent && { agent: httpAgent }),
};
} else {
req = {
method,
body: JSON.stringify(parseBody(body)),
headers: reqHeaders,
...(httpAgent && { agent: httpAgent }),
};
const agentConfig =
typeof window === 'undefined' ? { agent: defaultHttpAgent } : {};
const req: RequestInit = {
method,
headers: reqHeaders,
...agentConfig,
};
if (method !== 'get' && body !== undefined) {
req.body = JSON.stringify(parseBody(body));
}

@@ -354,0 +366,0 @@ return { req: req, url: url.toString() };

@@ -39,3 +39,4 @@ import { ApiClientInterface } from './_types/generalTypes';

mistralFimCompletion?: string | null | undefined;
constructor({ apiKey, baseURL, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, ...rest }: ApiClientInterface);
dangerouslyAllowBrowser?: boolean | null | undefined;
constructor({ apiKey, baseURL, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, dangerouslyAllowBrowser, ...rest }: ApiClientInterface);
completions: API.Completions;

@@ -42,0 +43,0 @@ chat: API.Chat;

@@ -40,2 +40,3 @@ "use strict";

const baseClient_1 = require("./baseClient.js");
const core_1 = require("./core.js");
const utils_1 = require("./utils.js");

@@ -45,3 +46,6 @@ class Portkey extends baseClient_1.ApiClient {

var _b, _c;
var { apiKey = (_b = (0, utils_1.readEnv)('PORTKEY_API_KEY')) !== null && _b !== void 0 ? _b : null, baseURL = (_c = (0, utils_1.readEnv)('PORTKEY_BASE_URL')) !== null && _c !== void 0 ? _c : null, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion } = _a, rest = __rest(_a, ["apiKey", "baseURL", "config", "virtualKey", "provider", "traceID", "metadata", "Authorization", "cacheForceRefresh", "debug", "customHost", "openaiProject", "openaiOrganization", "awsSecretAccessKey", "awsAccessKeyId", "awsSessionToken", "awsRegion", "vertexProjectId", "vertexRegion", "workersAiAccountId", "azureResourceName", "azureDeploymentId", "azureApiVersion", "azureEndpointName", "huggingfaceBaseUrl", "forwardHeaders", "cacheNamespace", "requestTimeout", "strictOpenAiCompliance", "anthropicBeta", "anthropicVersion", "mistralFimCompletion"]);
var { apiKey = (_b = (0, utils_1.readEnv)('PORTKEY_API_KEY')) !== null && _b !== void 0 ? _b : null, baseURL = (_c = (0, utils_1.readEnv)('PORTKEY_BASE_URL')) !== null && _c !== void 0 ? _c : null, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, dangerouslyAllowBrowser } = _a, rest = __rest(_a, ["apiKey", "baseURL", "config", "virtualKey", "provider", "traceID", "metadata", "Authorization", "cacheForceRefresh", "debug", "customHost", "openaiProject", "openaiOrganization", "awsSecretAccessKey", "awsAccessKeyId", "awsSessionToken", "awsRegion", "vertexProjectId", "vertexRegion", "workersAiAccountId", "azureResourceName", "azureDeploymentId", "azureApiVersion", "azureEndpointName", "huggingfaceBaseUrl", "forwardHeaders", "cacheNamespace", "requestTimeout", "strictOpenAiCompliance", "anthropicBeta", "anthropicVersion", "mistralFimCompletion", "dangerouslyAllowBrowser"]);
if ((0, core_1.isRunningInBrowser)() && !dangerouslyAllowBrowser) {
throw new Error("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Portkey({ ..., dangerouslyAllowBrowser: true, ... });");
}
super(Object.assign({ apiKey,

@@ -78,3 +82,4 @@ baseURL,

anthropicVersion,
mistralFimCompletion }, rest));
mistralFimCompletion,
dangerouslyAllowBrowser }, rest));
this.completions = new API.Completions(this);

@@ -139,2 +144,3 @@ this.chat = new API.Chat(this);

this.mistralFimCompletion = mistralFimCompletion;
this.dangerouslyAllowBrowser = dangerouslyAllowBrowser !== null && dangerouslyAllowBrowser !== void 0 ? dangerouslyAllowBrowser : false;
}

@@ -141,0 +147,0 @@ }

@@ -5,2 +5,3 @@ import { ApiClientInterface } from './_types/generalTypes';

import { ApiClient, APIPromise, RequestOptions } from './baseClient';
import { isRunningInBrowser } from './core';
import { Stream } from './streaming';

@@ -42,2 +43,3 @@ import { readEnv, setApiKey, setBaseURL } from './utils';

mistralFimCompletion?: string | null | undefined;
dangerouslyAllowBrowser?: boolean | null | undefined;
constructor({

@@ -76,4 +78,10 @@ apiKey = readEnv('PORTKEY_API_KEY') ?? null,

mistralFimCompletion,
dangerouslyAllowBrowser,
...rest
}: ApiClientInterface) {
if (isRunningInBrowser() && !dangerouslyAllowBrowser) {
throw new Error(
"It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Portkey({ ..., dangerouslyAllowBrowser: true, ... });"
);
}
super({

@@ -112,2 +120,3 @@ apiKey,

mistralFimCompletion,
dangerouslyAllowBrowser,
...rest,

@@ -146,2 +155,3 @@ });

this.mistralFimCompletion = mistralFimCompletion;
this.dangerouslyAllowBrowser = dangerouslyAllowBrowser ?? false;
}

@@ -148,0 +158,0 @@

@@ -19,2 +19,3 @@ "use strict";

const openai_1 = __importDefault(require("openai"));
const core_1 = require("./core.js");
const getPlatformProperties = () => {

@@ -27,2 +28,9 @@ if (Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]') {

}
const browserInfo = (0, core_1.getBrowserInfo)();
if (browserInfo) {
return {
[`${constants_1.PORTKEY_HEADER_PREFIX}runtime`]: `browser: ${browserInfo.browser}`,
[`${constants_1.PORTKEY_HEADER_PREFIX}runtime-version`]: browserInfo.version,
};
}
return {};

@@ -124,2 +132,3 @@ };

function initOpenAIClient(client) {
var _a;
return new openai_1.default({

@@ -130,7 +139,12 @@ apiKey: client.apiKey || (0, exports.readEnv)('OPENAI_API_KEY') || constants_1.OPEN_AI_API_KEY,

maxRetries: 0,
dangerouslyAllowBrowser: (_a = client.dangerouslyAllowBrowser) !== null && _a !== void 0 ? _a : false,
fetch: (url, init) => __awaiter(this, void 0, void 0, function* () {
var _b;
// NOTE: For adding duplex option only when body is a Readable stream
const fetchOptions = Object.assign(Object.assign({}, init), ((init === null || init === void 0 ? void 0 : init.body) &&
typeof ((_b = init.body) === null || _b === void 0 ? void 0 : _b.pipe) === 'function' && { duplex: 'half' }));
let isRetrying = false;
let response;
try {
response = yield fetch(url, init);
response = yield fetch(url, fetchOptions);
}

@@ -142,3 +156,3 @@ catch (error) {

(response && !response.ok && client._shouldRetry(response))) {
return yield fetch(url, init);
return yield fetch(url, fetchOptions);
}

@@ -145,0 +159,0 @@ else if (response) {

@@ -21,2 +21,3 @@ import {

import { LogsExportListParams } from './apis/logsExport';
import { getBrowserInfo } from './core';

@@ -38,2 +39,10 @@ type PlatformProperties = {

}
const browserInfo = getBrowserInfo();
if (browserInfo) {
return {
[`${PORTKEY_HEADER_PREFIX}runtime`]: `browser: ${browserInfo.browser}`,
[`${PORTKEY_HEADER_PREFIX}runtime-version`]: browserInfo.version,
};
}
return {};

@@ -157,7 +166,15 @@ };

maxRetries: 0,
dangerouslyAllowBrowser: client.dangerouslyAllowBrowser ?? false,
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
// NOTE: For adding duplex option only when body is a Readable stream
const fetchOptions: RequestInit = {
...init,
...(init?.body &&
typeof (init.body as any)?.pipe === 'function' && { duplex: 'half' }),
};
let isRetrying = false;
let response: Response | undefined;
try {
response = await fetch(url, init);
response = await fetch(url, fetchOptions);
} catch (error) {

@@ -170,3 +187,3 @@ isRetrying = true;

) {
return await fetch(url, init);
return await fetch(url, fetchOptions);
} else if (response) {

@@ -173,0 +190,0 @@ return response;

@@ -1,1 +0,1 @@

export declare const VERSION = "1.6.2";
export declare const VERSION = "1.6.3";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '1.6.2';
exports.VERSION = '1.6.3';
//# sourceMappingURL=version.js.map

@@ -1,1 +0,1 @@

export const VERSION = '1.6.2';
export const VERSION = '1.6.3';
{
"name": "portkey-ai",
"version": "1.6.2",
"version": "1.6.3",
"description": "Node client library for the Portkey API",

@@ -5,0 +5,0 @@ "types": "dist/src/index.d.ts",

@@ -36,2 +36,3 @@ export type Headers = Record<string, string | null | undefined>;

mistralFimCompletion?: string | null | undefined;
dangerouslyAllowBrowser?: boolean | null | undefined;
[key: string]: any;

@@ -38,0 +39,0 @@ }

@@ -19,3 +19,2 @@ import KeepAliveAgent from 'agentkeepalive';

import { VERSION } from './version';
fetch;
const defaultHttpAgent: Agent = new KeepAliveAgent({

@@ -25,2 +24,16 @@ keepAlive: true,

});
function getFetch(): Fetch {
if (typeof window !== 'undefined' && window.fetch) {
return window.fetch.bind(window);
}
if (typeof global !== 'undefined' && global.fetch) {
return global.fetch;
}
if (typeof fetch !== 'undefined') {
return fetch;
}
throw new Error('Fetch is not available in this environment');
}
export type Fetch = (url: string, init?: RequestInit) => Promise<Response>;

@@ -178,2 +191,3 @@

mistralFimCompletion,
dangerouslyAllowBrowser,
...rest

@@ -215,6 +229,7 @@ }: ApiClientInterface) {

anthropicBeta,
dangerouslyAllowBrowser,
...rest,
});
this.portkeyHeaders = this.defaultHeaders();
this.fetch = fetch;
this.fetch = getFetch();
this.responseHeaders = {};

@@ -337,17 +352,14 @@ }

};
const httpAgent: Agent | undefined = defaultHttpAgent;
let req: RequestInit;
if (method === 'get') {
req = {
method,
headers: reqHeaders,
...(httpAgent && { agent: httpAgent }),
};
} else {
req = {
method,
body: JSON.stringify(parseBody(body)),
headers: reqHeaders,
...(httpAgent && { agent: httpAgent }),
};
const agentConfig =
typeof window === 'undefined' ? { agent: defaultHttpAgent } : {};
const req: RequestInit = {
method,
headers: reqHeaders,
...agentConfig,
};
if (method !== 'get' && body !== undefined) {
req.body = JSON.stringify(parseBody(body));
}

@@ -354,0 +366,0 @@ return { req: req, url: url.toString() };

@@ -5,2 +5,3 @@ import { ApiClientInterface } from './_types/generalTypes';

import { ApiClient, APIPromise, RequestOptions } from './baseClient';
import { isRunningInBrowser } from './core';
import { Stream } from './streaming';

@@ -42,2 +43,3 @@ import { readEnv, setApiKey, setBaseURL } from './utils';

mistralFimCompletion?: string | null | undefined;
dangerouslyAllowBrowser?: boolean | null | undefined;
constructor({

@@ -76,4 +78,10 @@ apiKey = readEnv('PORTKEY_API_KEY') ?? null,

mistralFimCompletion,
dangerouslyAllowBrowser,
...rest
}: ApiClientInterface) {
if (isRunningInBrowser() && !dangerouslyAllowBrowser) {
throw new Error(
"It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Portkey({ ..., dangerouslyAllowBrowser: true, ... });"
);
}
super({

@@ -112,2 +120,3 @@ apiKey,

mistralFimCompletion,
dangerouslyAllowBrowser,
...rest,

@@ -146,2 +155,3 @@ });

this.mistralFimCompletion = mistralFimCompletion;
this.dangerouslyAllowBrowser = dangerouslyAllowBrowser ?? false;
}

@@ -148,0 +158,0 @@

@@ -21,2 +21,3 @@ import {

import { LogsExportListParams } from './apis/logsExport';
import { getBrowserInfo } from './core';

@@ -38,2 +39,10 @@ type PlatformProperties = {

}
const browserInfo = getBrowserInfo();
if (browserInfo) {
return {
[`${PORTKEY_HEADER_PREFIX}runtime`]: `browser: ${browserInfo.browser}`,
[`${PORTKEY_HEADER_PREFIX}runtime-version`]: browserInfo.version,
};
}
return {};

@@ -157,7 +166,15 @@ };

maxRetries: 0,
dangerouslyAllowBrowser: client.dangerouslyAllowBrowser ?? false,
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
// NOTE: For adding duplex option only when body is a Readable stream
const fetchOptions: RequestInit = {
...init,
...(init?.body &&
typeof (init.body as any)?.pipe === 'function' && { duplex: 'half' }),
};
let isRetrying = false;
let response: Response | undefined;
try {
response = await fetch(url, init);
response = await fetch(url, fetchOptions);
} catch (error) {

@@ -170,3 +187,3 @@ isRetrying = true;

) {
return await fetch(url, init);
return await fetch(url, fetchOptions);
} else if (response) {

@@ -173,0 +190,0 @@ return response;

@@ -1,1 +0,1 @@

export const VERSION = '1.6.2';
export const VERSION = '1.6.3';

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc