@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.
- package/es/firebase/index.js +1 -1
- package/es/otherUtils.d.ts +2 -0
- package/es/otherUtils.js +2 -0
- package/lib/firebase/index.js +1 -1
- package/lib/otherUtils.d.ts +2 -0
- package/lib/otherUtils.js +3 -0
- package/package.json +3 -2
package/es/firebase/index.js
CHANGED
|
@@ -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 = {};
|
package/es/otherUtils.d.ts
CHANGED
package/es/otherUtils.js
CHANGED
package/lib/firebase/index.js
CHANGED
|
@@ -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 = {};
|
package/lib/otherUtils.d.ts
CHANGED
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.
|
|
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",
|