@domql/utils
Advanced tools
Comparing version 2.5.93 to 2.5.94
'use strict' | ||
import { isUndefined } from './types' | ||
import { document } from '@domql/utils' | ||
@@ -5,0 +6,0 @@ export const isMobile = (() => typeof navigator === 'undefined' |
@@ -27,5 +27,6 @@ "use strict"; | ||
var import_types = require("./types"); | ||
var import_utils = require("@domql/utils"); | ||
const isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))(); | ||
const setCookie = (cname, cvalue, exdays = 365) => { | ||
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie)) | ||
if ((0, import_types.isUndefined)(import_utils.document) || (0, import_types.isUndefined)(import_utils.document.cookie)) | ||
return; | ||
@@ -35,9 +36,9 @@ const d = /* @__PURE__ */ new Date(); | ||
const expires = `expires=${d.toUTCString()}`; | ||
document.cookie = `${cname}=${cvalue};${expires};path=/`; | ||
import_utils.document.cookie = `${cname}=${cvalue};${expires};path=/`; | ||
}; | ||
const getCookie = (cname) => { | ||
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie)) | ||
if ((0, import_types.isUndefined)(import_utils.document) || (0, import_types.isUndefined)(import_utils.document.cookie)) | ||
return; | ||
const name = `${cname}=`; | ||
const decodedCookie = decodeURIComponent(document.cookie); | ||
const decodedCookie = decodeURIComponent(import_utils.document.cookie); | ||
const ca = decodedCookie.split(";"); | ||
@@ -44,0 +45,0 @@ for (let i = 0; i < ca.length; i++) { |
@@ -6,4 +6,4 @@ 'use strict' | ||
const window = globalThis | ||
const document = window.document // eslint-disable-line | ||
const document = (this || window).document // eslint-disable-line | ||
export { global, self, window, document } |
{ | ||
"name": "@domql/utils", | ||
"version": "2.5.93", | ||
"version": "2.5.94", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "type": "module", | ||
}, | ||
"gitHead": "6c5a9e10c74137700ad69ff9108b6ccc09745cc7", | ||
"gitHead": "76edeab829524b706fd1a0bd3fac3fd5563a3b84", | ||
"devDependencies": { | ||
@@ -29,0 +29,0 @@ "@babel/core": "^7.12.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74201
2288