@saritasa/crm-delmar-core-sdk 0.2.419 → 0.2.424
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/README.md
CHANGED
|
@@ -295,10 +295,8 @@ class Configuration {
|
|
|
295
295
|
* @return True if the given MIME is JSON, false otherwise.
|
|
296
296
|
*/
|
|
297
297
|
isJsonMime(mime) {
|
|
298
|
-
const jsonMime =
|
|
299
|
-
return
|
|
300
|
-
(jsonMime.test(mime) ||
|
|
301
|
-
mime.toLowerCase() === "application/json-patch+json"));
|
|
298
|
+
const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
|
|
299
|
+
return mime !== null && jsonMime.test(mime);
|
|
302
300
|
}
|
|
303
301
|
lookupCredential(key) {
|
|
304
302
|
const value = this.credentials[key];
|
|
@@ -380,23 +378,24 @@ class BaseService {
|
|
|
380
378
|
else if (value instanceof Date) {
|
|
381
379
|
return httpParams.append(key, value.toISOString());
|
|
382
380
|
}
|
|
383
|
-
else if (Array.isArray(value)) {
|
|
384
|
-
// Otherwise, if it's an array, add each element.
|
|
381
|
+
else if (Array.isArray(value) || value instanceof Set) {
|
|
382
|
+
// Otherwise, if it's an array or set, add each element.
|
|
383
|
+
const array = Array.isArray(value) ? value : Array.from(value);
|
|
385
384
|
if (paramStyle === QueryParamStyle.Form) {
|
|
386
|
-
return httpParams.set(key,
|
|
385
|
+
return httpParams.set(key, array, {
|
|
387
386
|
explode: explode,
|
|
388
387
|
delimiter: ",",
|
|
389
388
|
});
|
|
390
389
|
}
|
|
391
390
|
else if (paramStyle === QueryParamStyle.SpaceDelimited) {
|
|
392
|
-
return httpParams.set(key,
|
|
391
|
+
return httpParams.set(key, array, {
|
|
393
392
|
explode: explode,
|
|
394
393
|
delimiter: " ",
|
|
395
394
|
});
|
|
396
395
|
}
|
|
397
396
|
else {
|
|
398
397
|
// PipeDelimited
|
|
399
|
-
return httpParams.set(key,
|
|
398
|
+
return httpParams.set(key, array, {
|
|
400
399
|
explode: explode,
|
|
401
400
|
delimiter: "|",
|
|
402
401
|
});
|