type fix
This commit is contained in:
+1
-10
@@ -1,10 +1 @@
|
||||
export type HttpRequestExtraParams = {
|
||||
scheme?: "http" | "https";
|
||||
body?: {
|
||||
[x: string]: any;
|
||||
};
|
||||
query?: {
|
||||
[x: string]: any;
|
||||
};
|
||||
urlEncodedFormBody?: boolean;
|
||||
};
|
||||
export {};
|
||||
|
||||
@@ -6,18 +6,9 @@ import querystring from "querystring";
|
||||
import serializeQuery from "../../utils/serialize-query";
|
||||
import _ from "lodash";
|
||||
|
||||
/**
|
||||
* @typedef {object} HttpRequestExtraParams
|
||||
* @property {"http" | "https"} [scheme]
|
||||
* @property {Object<string, any>} [body]
|
||||
* @property {Object<string, any>} [query]
|
||||
* @property {boolean} [urlEncodedFormBody]
|
||||
*/
|
||||
|
||||
/**
|
||||
* # Generate a http Request
|
||||
* @param {import("node:https").RequestOptions & HttpRequestExtraParams} params
|
||||
*
|
||||
* @param {import("../../types").HttpRequestParams} params *
|
||||
* @returns { Promise<Object<string, any> | string | null> }
|
||||
*/
|
||||
async function httpRequest(params) {
|
||||
|
||||
Reference in New Issue
Block a user