swell-js 4.2.0 → 4.2.2
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/dist/api.mjs +9 -4
- package/dist/attributes.mjs +1 -1
- package/dist/cache.mjs +1 -1
- package/dist/card.mjs +1 -1
- package/dist/cart.mjs +1 -1
- package/dist/categories.mjs +1 -1
- package/dist/content.mjs +1 -1
- package/dist/cookie.mjs +2 -2
- package/dist/{index.738bc14a.mjs → index.6497db06.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/payment.mjs +1 -1
- package/dist/products.mjs +1 -1
- package/dist/settings.mjs +1 -1
- package/dist/subscriptions.mjs +1 -1
- package/dist/swell.cjs +10 -5
- package/dist/swell.cjs.map +1 -1
- package/dist/swell.umd.min.js +10 -5
- package/dist/swell.umd.min.js.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
package/dist/swell.umd.min.js
CHANGED
|
@@ -10033,7 +10033,7 @@
|
|
|
10033
10033
|
}
|
|
10034
10034
|
|
|
10035
10035
|
function isServer() {
|
|
10036
|
-
return !(typeof window !== 'undefined' && window
|
|
10036
|
+
return !(typeof window !== 'undefined' && window?.document);
|
|
10037
10037
|
}
|
|
10038
10038
|
|
|
10039
10039
|
function isFunction(func) {
|
|
@@ -10406,7 +10406,7 @@
|
|
|
10406
10406
|
return undefined;
|
|
10407
10407
|
}
|
|
10408
10408
|
|
|
10409
|
-
const matches = document.cookie
|
|
10409
|
+
const matches = window.document.cookie?.match(
|
|
10410
10410
|
new RegExp(
|
|
10411
10411
|
'(?:^|; )' + name.replace(/([.$?*|{}()[]\\\/\+^])/g, '\\$1') + '=([^;]*)',
|
|
10412
10412
|
),
|
|
@@ -15602,7 +15602,7 @@
|
|
|
15602
15602
|
};
|
|
15603
15603
|
|
|
15604
15604
|
const api = {
|
|
15605
|
-
version: '4.2.
|
|
15605
|
+
version: '4.2.2',
|
|
15606
15606
|
options,
|
|
15607
15607
|
request,
|
|
15608
15608
|
|
|
@@ -15751,8 +15751,13 @@
|
|
|
15751
15751
|
method: reqMethod,
|
|
15752
15752
|
headers: reqHeaders,
|
|
15753
15753
|
body: reqBody,
|
|
15754
|
-
|
|
15755
|
-
|
|
15754
|
+
// Credentials and mode are only available in the browser
|
|
15755
|
+
...(!isServer()
|
|
15756
|
+
? {
|
|
15757
|
+
credentials: 'include',
|
|
15758
|
+
mode: 'cors',
|
|
15759
|
+
}
|
|
15760
|
+
: undefined),
|
|
15756
15761
|
});
|
|
15757
15762
|
|
|
15758
15763
|
const responseSession = response.headers.get('X-Session');
|