@rebuy/rebuy 1.3.5 → 1.3.7
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/api.js +5 -3
- package/cookie.js +2 -2
- package/geolocation.js +1 -1
- package/identity.js +1 -1
- package/package.json +1 -1
- package/session.js +1 -1
package/api.js
CHANGED
|
@@ -26,14 +26,16 @@ const makeCall = async (method, path, data, origin, options = {}) => {
|
|
|
26
26
|
const requestUrl = new URL(url);
|
|
27
27
|
const fetchOptions = options?.fetch ?? {};
|
|
28
28
|
|
|
29
|
-
const requestData = {
|
|
30
|
-
key: config.key,
|
|
31
|
-
};
|
|
29
|
+
const requestData = {};
|
|
32
30
|
|
|
33
31
|
if (typeof data == 'object' && data != null) {
|
|
34
32
|
Object.assign(requestData, data);
|
|
35
33
|
}
|
|
36
34
|
|
|
35
|
+
if (typeof config.key == 'string' && config.key.length > 0) {
|
|
36
|
+
Object.assign(requestData, { key: config.key });
|
|
37
|
+
}
|
|
38
|
+
|
|
37
39
|
const requestObject = {
|
|
38
40
|
method,
|
|
39
41
|
...fetchOptions,
|
package/cookie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dataToString, stringToData, isBase64Encoded } from './utilities.js';
|
|
2
2
|
|
|
3
3
|
export function get(name) {
|
|
4
|
-
if (typeof document == 'undefined') {
|
|
4
|
+
if (typeof document == 'undefined' || !document.cookie) {
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -49,7 +49,7 @@ export function getAll() {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export function set(name, value, config) {
|
|
52
|
-
if (typeof document == 'undefined') {
|
|
52
|
+
if (typeof document == 'undefined' || !document.cookie) {
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
55
|
|
package/geolocation.js
CHANGED
package/identity.js
CHANGED
package/package.json
CHANGED