From e28cf872ea64268ded1ba6b49f80100b3f1937b7 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sun, 5 Jan 2025 09:10:33 +0100 Subject: [PATCH] type fix --- .../functions/backend/httpRequest.d.ts | 3 ++- package-shared/functions/backend/httpRequest.js | 16 +++++++--------- package.json | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package-shared/functions/backend/httpRequest.d.ts b/package-shared/functions/backend/httpRequest.d.ts index cb0ff5c..61414c7 100644 --- a/package-shared/functions/backend/httpRequest.d.ts +++ b/package-shared/functions/backend/httpRequest.d.ts @@ -1 +1,2 @@ -export {}; +declare const _exports: import("../../types").HttpRequestFunctionType; +export = _exports; diff --git a/package-shared/functions/backend/httpRequest.js b/package-shared/functions/backend/httpRequest.js index 6827570..8e14819 100644 --- a/package-shared/functions/backend/httpRequest.js +++ b/package-shared/functions/backend/httpRequest.js @@ -1,16 +1,16 @@ // @ts-check -import http from "node:http"; -import https from "node:https"; -import querystring from "querystring"; -import serializeQuery from "../../utils/serialize-query"; -import _ from "lodash"; +const http = require("node:http"); +const https = require("node:https"); +const querystring = require("querystring"); +const serializeQuery = require("../../utils/serialize-query"); +const _ = require("lodash"); /** * # Generate a http Request * @type {import("../../types").HttpRequestFunctionType} */ -async function httpRequest(params) { +module.exports = function httpRequest(params) { return new Promise((resolve, reject) => { const isUrlEncodedFormBody = params.urlEncodedFormBody; @@ -91,6 +91,4 @@ async function httpRequest(params) { httpsRequest.end(); }); -} - -module.exports = httpRequest; +}; diff --git a/package.json b/package.json index f9abc09..1848637 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.3.3", + "version": "3.3.4", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {