dce-reactkit 3.7.38 → 3.8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.7.38",
3
+ "version": "3.8.0",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -129,12 +129,26 @@ const visitServerEndpoint = async (
129
129
  params = Object.fromEntries(
130
130
  Object
131
131
  .entries(opts.params)
132
- .filter(([key, value]) => {
132
+ .filter(([, value]) => {
133
133
  return value !== undefined;
134
134
  }),
135
135
  );
136
136
  }
137
137
 
138
+ // Automatically JSONify arrays and objects
139
+ if (params) {
140
+ params = Object.fromEntries(
141
+ Object
142
+ .entries(params)
143
+ .map(([key, value]) => {
144
+ if (Array.isArray(value) || typeof value === 'object') {
145
+ return [key, JSON.stringify(value)];
146
+ }
147
+ return [key, value];
148
+ }),
149
+ );
150
+ }
151
+
138
152
  // Send the request
139
153
  const sendRequest = await getSendRequest();
140
154
  const response = await sendRequest({