@empathyco/x-adapter
Advanced tools
Comparing version 8.0.0-alpha.8 to 8.0.0-alpha.9
@@ -19,4 +19,4 @@ "use strict"; | ||
const flatParameters = (0, x_utils_1.flatObject)(parameters); | ||
const url = sendParamsInBody ? endpoint : (0, utils_1.buildUrl)(endpoint, flatParameters); | ||
const bodyParameters = sendParamsInBody ? { body: JSON.stringify(parameters) } : {}; | ||
const url = sendParamsInBody ? endpoint : (0, utils_1.buildUrl)(endpoint, (0, x_utils_1.cleanEmpty)(flatParameters)); | ||
const bodyParameters = sendParamsInBody ? { body: JSON.stringify((0, x_utils_1.cleanEmpty)(parameters)) } : {}; | ||
return fetch(url, { | ||
@@ -23,0 +23,0 @@ ...properties, |
@@ -1,2 +0,2 @@ | ||
import { flatObject } from '@empathyco/x-utils'; | ||
import { cleanEmpty, flatObject } from '@empathyco/x-utils'; | ||
import { buildUrl, toJson } from './utils'; | ||
@@ -16,4 +16,4 @@ /** | ||
const flatParameters = flatObject(parameters); | ||
const url = sendParamsInBody ? endpoint : buildUrl(endpoint, flatParameters); | ||
const bodyParameters = sendParamsInBody ? { body: JSON.stringify(parameters) } : {}; | ||
const url = sendParamsInBody ? endpoint : buildUrl(endpoint, cleanEmpty(flatParameters)); | ||
const bodyParameters = sendParamsInBody ? { body: JSON.stringify(cleanEmpty(parameters)) } : {}; | ||
return fetch(url, { | ||
@@ -20,0 +20,0 @@ ...properties, |
{ | ||
"name": "@empathyco/x-adapter", | ||
"version": "8.0.0-alpha.8", | ||
"version": "8.0.0-alpha.9", | ||
"description": "A utils library to create a client for any API", | ||
@@ -35,3 +35,3 @@ "author": "Empathy Systems Corporation S.L.", | ||
"dependencies": { | ||
"@empathyco/x-deep-merge": "^1.3.0-alpha.21", | ||
"@empathyco/x-deep-merge": "^1.3.0-alpha.22", | ||
"@empathyco/x-get-safe-property-chain": "^1.3.0-alpha.3", | ||
@@ -41,3 +41,3 @@ "tslib": "~2.3.0" | ||
"devDependencies": { | ||
"@empathyco/x-utils": "^1.0.0-alpha.7", | ||
"@empathyco/x-utils": "^1.0.0-alpha.8", | ||
"@types/jest": "~27.0.3", | ||
@@ -53,3 +53,3 @@ "concurrently": "~7.0.0", | ||
}, | ||
"gitHead": "c2150c4957ff99d27ce904c8554d72ac61261f36" | ||
"gitHead": "980f3e6628cfedad38f5f5ceeefbb24544b38cb6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
167524