quiver-client 0.22.0 → 0.24.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.
Files changed (2) hide show
  1. package/dist/client.js +7 -1
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -25,7 +25,13 @@ export class Client {
25
25
  #timeoutMs;
26
26
  #fetch;
27
27
  constructor(baseUrl = DEFAULT_BASE_URL, opts = {}) {
28
- this.#baseUrl = baseUrl.replace(/\/+$/, "");
28
+ // Strip trailing slashes with a linear scan rather than a quantified regex
29
+ // (`/\/+$/`), which static analysis flags as polynomial-backtracking on the
30
+ // caller-supplied base URL.
31
+ let end = baseUrl.length;
32
+ while (end > 0 && baseUrl.charCodeAt(end - 1) === 47 /* "/" */)
33
+ end--;
34
+ this.#baseUrl = baseUrl.slice(0, end);
29
35
  this.#headers = { "content-type": "application/json" };
30
36
  if (opts.apiKey) {
31
37
  this.#headers["authorization"] = `Bearer ${opts.apiKey}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiver-client",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "TypeScript client for Quiver — a security-first, memory-frugal vector database.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "packageManager": "pnpm@11.6.0",