From f1e0aa9fc48190d63f877fc826a8717a58be8e2a Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Fri, 26 Dec 2025 12:21:27 +0100 Subject: [PATCH] Updates --- client/crud-fetch/index.ts | 7 ++++--- dist/client/crud-fetch/index.js | 6 +++--- package.json | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/crud-fetch/index.ts b/client/crud-fetch/index.ts index 0940acb..cdc4786 100644 --- a/client/crud-fetch/index.ts +++ b/client/crud-fetch/index.ts @@ -1,4 +1,3 @@ -import path from "path"; import { APIResponseObject, ClientCrudFetchParams, @@ -24,16 +23,18 @@ export default async function clientCrudFetch< try { let pathname = basePath || ``; - pathname = path.join(pathname, String(table)); + pathname += `/${String(table)}`; if (targetId) { - pathname = path.join(pathname, String(targetId)); + pathname += `/${String(targetId)}`; } if (query) { pathname = `${pathname}${serializeQuery(query)}`; } + pathname = pathname.replace(/\/{2,}/g, "/"); + pathname = apiOrigin ? `${apiOrigin}/${pathname}`.replace(/([^:]\/)\/+/g, "$1") : pathname; diff --git a/dist/client/crud-fetch/index.js b/dist/client/crud-fetch/index.js index a7c214a..07f295f 100644 --- a/dist/client/crud-fetch/index.js +++ b/dist/client/crud-fetch/index.js @@ -13,20 +13,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = clientCrudFetch; -const path_1 = __importDefault(require("path")); const serialize_query_1 = __importDefault(require("../../package-shared/utils/serialize-query")); const fetch_1 = __importDefault(require("../fetch")); function clientCrudFetch(_a) { return __awaiter(this, arguments, void 0, function* ({ table, basePath, body, query, targetId, method = "GET", apiOrigin, headers, }) { try { let pathname = basePath || ``; - pathname = path_1.default.join(pathname, String(table)); + pathname += `/${String(table)}`; if (targetId) { - pathname = path_1.default.join(pathname, String(targetId)); + pathname += `/${String(targetId)}`; } if (query) { pathname = `${pathname}${(0, serialize_query_1.default)(query)}`; } + pathname = pathname.replace(/\/{2,}/g, "/"); pathname = apiOrigin ? `${apiOrigin}/${pathname}`.replace(/([^:]\/)\/+/g, "$1") : pathname; diff --git a/package.json b/package.json index ae4d7e6..2e0efbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "5.6.2", + "version": "5.6.3", "description": "Cloud-based SQL data management tool", "main": "dist/index.js", "bin": {