@doctadevs/utils
Advanced tools
Comparing version 0.0.28 to 0.0.29
@@ -0,1 +1,2 @@ | ||
import { MultigetRead } from '@doctadevs/types'; | ||
export declare type RequestOptions<DataType = BodyInit> = { | ||
@@ -13,1 +14,2 @@ url: string; | ||
export declare const extractIPV4FromHeader: (xForwardedForOrRealIPHeader: string) => string; | ||
export declare const convertEndpointsToQueryString: (endpointsConfiguration: MultigetRead[]) => string; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.extractIPV4FromHeader = exports.request = void 0; | ||
exports.convertEndpointsToQueryString = exports.extractIPV4FromHeader = exports.request = void 0; | ||
const cross_fetch_1 = __importDefault(require("cross-fetch")); | ||
@@ -33,2 +33,6 @@ const request = async ({ url, method = 'GET', data, queryParams = {}, token = '', contentType = 'json', }) => cross_fetch_1.default(`${url}${!Object.keys(queryParams).length | ||
exports.extractIPV4FromHeader = extractIPV4FromHeader; | ||
const convertEndpointsToQueryString = (endpointsConfiguration) => endpointsConfiguration | ||
.map(({ endpoint, action, queryParam, queryValue }) => [endpoint, action, queryParam, queryValue].filter(Boolean).join(',')) | ||
.join('|'); | ||
exports.convertEndpointsToQueryString = convertEndpointsToQueryString; | ||
//# sourceMappingURL=http.js.map |
{ | ||
"name": "@doctadevs/utils", | ||
"version": "0.0.28", | ||
"version": "0.0.29", | ||
"main": "dist/index.js", | ||
@@ -34,3 +34,3 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@doctadevs/types": "^0.0.47", | ||
"@doctadevs/types": "^0.0.51", | ||
"@types/uuid": "^8.3.1", | ||
@@ -37,0 +37,0 @@ "cross-fetch": "^3.1.4", |
@@ -0,1 +1,2 @@ | ||
import { MultigetRead } from '@doctadevs/types'; | ||
import fetch from 'cross-fetch'; | ||
@@ -47,1 +48,8 @@ | ||
}; | ||
export const convertEndpointsToQueryString = (endpointsConfiguration: MultigetRead[]): string => | ||
endpointsConfiguration | ||
.map(({ endpoint, action, queryParam, queryValue }) => | ||
[endpoint, action, queryParam, queryValue].filter(Boolean).join(','), | ||
) | ||
.join('|'); |
Sorry, the diff of this file is not supported yet
20651
352
+ Added@doctadevs/types@0.0.51(transitive)
- Removed@doctadevs/types@0.0.47(transitive)
Updated@doctadevs/types@^0.0.51