@pisell/utils 1.0.32 → 1.0.34

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.
@@ -11,7 +11,7 @@ import { isUndefined } from "../typeUtils";
11
11
  var isClient = typeof window != "undefined" && window.document;
12
12
 
13
13
  // 是否默认初始化firebase erp_admin默认不初始化
14
- var isDefaultInit = isUndefined((_window = window) === null || _window === void 0 ? void 0 : _window.__isDefaultInit) ? true : (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__isDefaultInit;
14
+ var isDefaultInit = isClient && (isUndefined((_window = window) === null || _window === void 0 ? void 0 : _window.__isDefaultInit) ? true : (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__isDefaultInit);
15
15
  var isInitialized = false;
16
16
  var firebaseApp = {};
17
17
  var auth = {};
@@ -1,3 +1,5 @@
1
+ import { detectIncognito } from "detect-incognito";
2
+ export { detectIncognito };
1
3
  /**
2
4
  * @Description: 生成唯一id
3
5
  * @Author: wzw
package/es/otherUtils.js CHANGED
@@ -2,6 +2,8 @@
2
2
  import md5 from "crypto-js/md5";
3
3
  // @ts-ignore
4
4
  import enc from "crypto-js/enc-hex";
5
+ import { detectIncognito } from "detect-incognito";
6
+ export { detectIncognito };
5
7
 
6
8
  /**
7
9
  * @Description: 生成唯一id
@@ -45,7 +45,7 @@ var import_database = require("firebase/database");
45
45
  var import_config = require("./config");
46
46
  var import_typeUtils = require("../typeUtils");
47
47
  var isClient = typeof window != "undefined" && window.document;
48
- var isDefaultInit = (0, import_typeUtils.isUndefined)(window == null ? void 0 : window.__isDefaultInit) ? true : window == null ? void 0 : window.__isDefaultInit;
48
+ var isDefaultInit = isClient && ((0, import_typeUtils.isUndefined)(window == null ? void 0 : window.__isDefaultInit) ? true : window == null ? void 0 : window.__isDefaultInit);
49
49
  var isInitialized = false;
50
50
  var firebaseApp = {};
51
51
  var auth = {};
@@ -1,3 +1,5 @@
1
+ import { detectIncognito } from "detect-incognito";
2
+ export { detectIncognito };
1
3
  /**
2
4
  * @Description: 生成唯一id
3
5
  * @Author: wzw
package/lib/otherUtils.js CHANGED
@@ -31,6 +31,7 @@ var otherUtils_exports = {};
31
31
  __export(otherUtils_exports, {
32
32
  changeArray: () => changeArray,
33
33
  createArray: () => createArray,
34
+ detectIncognito: () => import_detect_incognito.detectIncognito,
34
35
  generateUniqueIdByObj: () => generateUniqueIdByObj,
35
36
  getItemByArray: () => getItemByArray,
36
37
  getUniqueId: () => getUniqueId
@@ -38,6 +39,7 @@ __export(otherUtils_exports, {
38
39
  module.exports = __toCommonJS(otherUtils_exports);
39
40
  var import_md5 = __toESM(require("crypto-js/md5"));
40
41
  var import_enc_hex = __toESM(require("crypto-js/enc-hex"));
42
+ var import_detect_incognito = require("detect-incognito");
41
43
  var getUniqueId = (prefix = "", maxLength = 11) => {
42
44
  return prefix + (Math.random() + "").replace(/\D/g, "").substring(0, maxLength);
43
45
  };
@@ -79,6 +81,7 @@ var generateUniqueIdByObj = (obj) => {
79
81
  0 && (module.exports = {
80
82
  changeArray,
81
83
  createArray,
84
+ detectIncognito,
82
85
  generateUniqueIdByObj,
83
86
  getItemByArray,
84
87
  getUniqueId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/utils",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",
@@ -13,7 +13,8 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "firebase": "10.5.0",
16
- "crypto-js": "^4.2.0"
16
+ "crypto-js": "^4.2.0",
17
+ "detect-incognito": "1.0.0"
17
18
  },
18
19
  "files": [
19
20
  "es",