@searchspring/snap-toolbox 0.53.3 → 0.54.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.
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.featureFlags = exports.getFlags = void 0;
|
|
4
4
|
function getFlags(userAgent) {
|
|
5
5
|
if (userAgent === void 0) { userAgent = ''; }
|
|
6
|
-
userAgent = (userAgent || (window
|
|
6
|
+
userAgent = (userAgent || (typeof window == 'undefined' ? {} : window === null || window === void 0 ? void 0 : window.navigator).userAgent || '').toLowerCase();
|
|
7
7
|
var isIE = (function () {
|
|
8
8
|
var ieVersion;
|
|
9
9
|
return function isIE() {
|
|
@@ -19,13 +19,14 @@ function getFlags(userAgent) {
|
|
|
19
19
|
return !isIE() || Number(isIE()) >= 10;
|
|
20
20
|
},
|
|
21
21
|
cookies: function () {
|
|
22
|
-
|
|
22
|
+
var _a;
|
|
23
|
+
return typeof window == 'undefined' ? false : (_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.cookieEnabled;
|
|
23
24
|
},
|
|
24
25
|
storage: function () {
|
|
25
26
|
var test = 'ss-test';
|
|
26
27
|
try {
|
|
27
|
-
window.localStorage.setItem(test, test);
|
|
28
|
-
window.localStorage.removeItem(test);
|
|
28
|
+
window === null || window === void 0 ? void 0 : window.localStorage.setItem(test, test);
|
|
29
|
+
window === null || window === void 0 ? void 0 : window.localStorage.removeItem(test);
|
|
29
30
|
return true;
|
|
30
31
|
}
|
|
31
32
|
catch (e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function getFlags(userAgent = '') {
|
|
2
|
-
userAgent = (userAgent || (window
|
|
2
|
+
userAgent = (userAgent || (typeof window == 'undefined' ? {} : window?.navigator).userAgent || '').toLowerCase();
|
|
3
3
|
const isIE = (function () {
|
|
4
4
|
let ieVersion;
|
|
5
5
|
return function isIE() {
|
|
@@ -15,13 +15,13 @@ export function getFlags(userAgent = '') {
|
|
|
15
15
|
return !isIE() || Number(isIE()) >= 10;
|
|
16
16
|
},
|
|
17
17
|
cookies: function () {
|
|
18
|
-
return window
|
|
18
|
+
return typeof window == 'undefined' ? false : window?.navigator?.cookieEnabled;
|
|
19
19
|
},
|
|
20
20
|
storage: function () {
|
|
21
21
|
const test = 'ss-test';
|
|
22
22
|
try {
|
|
23
|
-
window
|
|
24
|
-
window
|
|
23
|
+
window?.localStorage.setItem(test, test);
|
|
24
|
+
window?.localStorage.removeItem(test);
|
|
25
25
|
return true;
|
|
26
26
|
}
|
|
27
27
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchspring/snap-toolbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Snap Toolbox",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"dist/**/*"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "a54d2c6579bf83500ed2faca8ff72b3e3495f063"
|
|
27
27
|
}
|