🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@algolia/client-common

Package Overview
Dependencies
Maintainers
0
Versions
268
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/client-common - npm Package Compare versions

Comparing version

to
5.16.0

10

dist/common.d.ts

@@ -319,3 +319,3 @@ type Cache = {

*/
aggregator: (response: TResponse) => void;
aggregator: (response: TResponse) => unknown | PromiseLike<unknown>;
/**

@@ -328,7 +328,7 @@ * The `validate` condition to throw an error and its message.

*/
validate: (response: TResponse) => boolean;
validate: (response: TResponse) => boolean | PromiseLike<boolean>;
/**
* The error message to throw.
*/
message: (response: TResponse) => string;
message: (response: TResponse) => string | PromiseLike<string>;
};

@@ -338,3 +338,3 @@ /**

*/
timeout: () => number;
timeout: () => number | PromiseLike<number>;
}>;

@@ -351,3 +351,3 @@ type CreateIterablePromise<TResponse> = IterableOptions<TResponse> & {

*/
validate: (response: TResponse) => boolean;
validate: (response: TResponse) => boolean | PromiseLike<boolean>;
};

@@ -354,0 +354,0 @@

@@ -209,15 +209,18 @@ // src/cache/createBrowserLocalStorageCache.ts

return new Promise((resolve, reject) => {
func(previousResponse).then((response) => {
func(previousResponse).then(async (response) => {
if (aggregator) {
aggregator(response);
await aggregator(response);
}
if (validate(response)) {
if (await validate(response)) {
return resolve(response);
}
if (error && error.validate(response)) {
return reject(new Error(error.message(response)));
if (error && await error.validate(response)) {
return reject(new Error(await error.message(response)));
}
return setTimeout(() => {
retry(response).then(resolve).catch(reject);
}, timeout());
return setTimeout(
() => {
retry(response).then(resolve).catch(reject);
},
await timeout()
);
}).catch((err) => {

@@ -224,0 +227,0 @@ reject(err);

{
"name": "@algolia/client-common",
"version": "5.15.0",
"version": "5.16.0",
"description": "Common package for the Algolia JavaScript API client.",

@@ -9,2 +9,3 @@ "repository": {

},
"homepage": "https://github.com/algolia/algoliasearch-client-javascript#readme",
"license": "MIT",

@@ -34,8 +35,8 @@ "author": "Algolia",

"clean": "rm -rf ./dist || true",
"test": "vitest --run",
"test": "tsc --noEmit && vitest --run",
"test:bundle": "publint . && attw --pack ."
},
"devDependencies": {
"@arethetypeswrong/cli": "0.17.0",
"@types/node": "22.9.0",
"@arethetypeswrong/cli": "0.17.1",
"@types/node": "22.10.1",
"jsdom": "25.0.1",

@@ -45,4 +46,4 @@ "publint": "0.2.12",

"tsup": "8.3.5",
"typescript": "5.6.3",
"vitest": "2.1.5"
"typescript": "5.7.2",
"vitest": "2.1.8"
},

@@ -49,0 +50,0 @@ "engines": {

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