@basis-theory/basis-theory-js 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/common/utils.js +9 -3
  2. package/package.json +2 -2
package/common/utils.js CHANGED
@@ -246,11 +246,12 @@ const getQueryParams = query => {
246
246
  if (keys.length) {
247
247
  const params = new URLSearchParams();
248
248
 
249
- const appendSafe = (key, value) => {
250
- const type = typeof value; // eslint-disable-next-line unicorn/no-null
249
+ const appendSafe = (key, value, isNested = false) => {
250
+ const type = typeof value;
251
+ const formattedKey = isNested ? key : (0, _snakeCase.snakeCase)(key); // eslint-disable-next-line unicorn/no-null
251
252
 
252
253
  if (value === null || ['boolean', 'number', 'string'].includes(type)) {
253
- params.append((0, _snakeCase.snakeCase)(key), value);
254
+ params.append(formattedKey, value);
254
255
  }
255
256
  };
256
257
 
@@ -261,6 +262,11 @@ const getQueryParams = query => {
261
262
  value.forEach(aValue => {
262
263
  appendSafe(String(key), aValue);
263
264
  });
265
+ } else if (value && typeof value === 'object') {
266
+ const objectKeys = Object.keys(value);
267
+ objectKeys.forEach(objectKey => {
268
+ appendSafe(`${key}.${objectKey}`, value[objectKey], true);
269
+ });
264
270
  } else {
265
271
  appendSafe(String(key), value);
266
272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "1.18.0",
3
+ "version": "1.19.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -15,7 +15,7 @@
15
15
  "!*.bundle.js"
16
16
  ],
17
17
  "dependencies": {
18
- "@basis-theory/basis-theory-elements-interfaces": "^3.0.0",
18
+ "@basis-theory/basis-theory-elements-interfaces": "^3.2.0",
19
19
  "axios": "^0.21.2",
20
20
  "camelcase-keys": "^6.2.2",
21
21
  "snake-case": "^3.0.4",