vite-uni-dev-tool 0.0.48 → 1.0.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.
- package/README.md +20 -0
- package/dist/const.cjs +1 -0
- package/dist/const.d.ts +78 -161
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -47
- package/dist/core-shared.d.ts +44 -0
- package/dist/core-shared.d.ts.map +1 -0
- package/dist/core-shared.js +1 -0
- package/dist/core.d.ts +2 -40
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +4 -159
- package/dist/i18n/index.cjs +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/instance.cjs +1 -0
- package/dist/i18n/instance.d.ts +15 -0
- package/dist/i18n/instance.d.ts.map +1 -0
- package/dist/i18n/instance.js +1 -0
- package/dist/i18n/locales/en.cjs +1 -0
- package/dist/i18n/locales/en.d.ts +470 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/zh-Hans.cjs +1 -0
- package/dist/i18n/locales/zh-Hans.d.ts +476 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
- package/dist/i18n/locales/zh-Hans.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/devConsole/index.cjs +4 -0
- package/dist/{devConsole → modules/devConsole}/index.d.ts +1 -1
- package/dist/modules/devConsole/index.d.ts.map +1 -0
- package/dist/modules/devConsole/index.js +4 -0
- package/dist/modules/devEvent/index.cjs +5 -0
- package/dist/modules/devEvent/index.d.ts +115 -0
- package/dist/modules/devEvent/index.d.ts.map +1 -0
- package/dist/modules/devEvent/index.js +5 -0
- package/dist/modules/devIntercept/index.cjs +13 -0
- package/dist/modules/devIntercept/index.d.ts +71 -0
- package/dist/modules/devIntercept/index.d.ts.map +1 -0
- package/dist/modules/devIntercept/index.js +13 -0
- package/dist/modules/devStore/index.cjs +1 -0
- package/dist/modules/devStore/index.d.ts +159 -0
- package/dist/modules/devStore/index.d.ts.map +1 -0
- package/dist/modules/devStore/index.js +1 -0
- package/dist/modules/devToolInfo/index.cjs +1 -0
- package/dist/modules/devToolInfo/index.d.ts +27 -0
- package/dist/modules/devToolInfo/index.d.ts.map +1 -0
- package/dist/modules/devToolInfo/index.js +1 -0
- package/dist/plugins/uniDevTool/transform/transformApp.cjs +44 -0
- package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformApp.js +17 -17
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -0
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
- package/dist/plugins/uniDevTool/transform/transformVue.cjs +41 -0
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +1 -2
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +32 -19
- package/dist/plugins/uniDevTool/uniDevTool.cjs +5 -0
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -11
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.cjs +19 -0
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +1 -1
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.js +11 -19
- package/dist/plugins/uniParseStock/index.d.ts +10 -0
- package/dist/plugins/uniParseStock/index.d.ts.map +1 -0
- package/dist/plugins/utils/index.cjs +2 -0
- package/dist/plugins/utils/index.d.ts +1 -3
- package/dist/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +2 -2
- package/dist/shims-uni.d.ts +140 -0
- package/dist/type.d.ts +174 -16
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/array.cjs +1 -0
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js +1 -12
- package/dist/utils/date.cjs +1 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +1 -59
- package/dist/utils/file.cjs +1 -0
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +1 -85
- package/dist/utils/function.cjs +1 -0
- package/dist/utils/function.d.ts +13 -0
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +1 -68
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -63
- package/dist/utils/ip.cjs +1 -0
- package/dist/utils/ip.d.ts +1 -1
- package/dist/utils/ip.d.ts.map +1 -1
- package/dist/utils/ip.js +1 -45
- package/dist/utils/language.cjs +1 -0
- package/dist/utils/language.d.ts +2 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +1 -63
- package/dist/utils/object.cjs +1 -0
- package/dist/utils/object.d.ts +4 -5
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -136
- package/dist/utils/openLink.cjs +1 -0
- package/dist/utils/openLink.d.ts.map +1 -1
- package/dist/utils/openLink.js +1 -28
- package/dist/utils/page.cjs +1 -0
- package/dist/utils/page.d.ts.map +1 -1
- package/dist/utils/page.js +1 -7
- package/dist/utils/platform.cjs +1 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +1 -17
- package/dist/utils/string.cjs +1 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -114
- package/dist/utils/utils.cjs +1 -0
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +1 -126
- package/dist/v3/AppTransition/index.vue +170 -0
- package/dist/v3/AutoSizer/index.vue +4 -5
- package/dist/v3/AutoSizer/index1.vue +4 -6
- package/dist/v3/AutoSizer/utils.ts +1 -1
- package/dist/v3/CaptureScreen/index.vue +19 -8
- package/dist/v3/CircularButton/index.vue +64 -13
- package/dist/v3/ConsoleList/ConsoleItem.vue +56 -5
- package/dist/v3/ConsoleList/RunJSInput.vue +10 -6
- package/dist/v3/ConsoleList/index.vue +51 -35
- package/dist/v3/CustomSwiper/CustomSwiperItem.vue +49 -0
- package/dist/v3/CustomSwiper/index.vue +104 -0
- package/dist/v3/DevTool/fps-collector.render.ts +148 -0
- package/dist/v3/DevTool/index.vue +209 -102
- package/dist/v3/DevToolButton/index.vue +40 -59
- package/dist/v3/DevToolTitle/index.vue +4 -1
- package/dist/v3/DevToolWindow/DevToolOverlay.vue +182 -0
- package/dist/v3/DevToolWindow/const.ts +47 -69
- package/dist/v3/DevToolWindow/hooks/dataUtils.ts +48 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolData.ts +338 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolHandlers.ts +549 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolOverlay.ts +184 -0
- package/dist/v3/DevToolWindow/index.css +89 -0
- package/dist/v3/DevToolWindow/index.vue +800 -1450
- package/dist/v3/DraggableContainer/index.vue +456 -0
- package/dist/v3/ElEvent/ElEventItem.vue +4 -3
- package/dist/v3/ElEvent/index.vue +26 -9
- package/dist/v3/Empty/index.vue +1 -0
- package/dist/v3/FilterInput/index.vue +8 -22
- package/dist/v3/FilterSelect/index.vue +37 -24
- package/dist/v3/Instance/components/InstanceTreeNode.vue +265 -0
- package/dist/v3/Instance/flatten.ts +226 -0
- package/dist/v3/Instance/index.vue +94 -0
- package/dist/v3/Instance/registry.ts +49 -0
- package/dist/v3/Instance/transformTree.ts +375 -0
- package/dist/v3/Instance/transformTreeCtx.ts +268 -0
- package/dist/v3/{InstanceTree → Instance}/typing.d.ts +15 -2
- package/dist/v3/InstanceDetail/index.vue +433 -44
- package/dist/v3/JsonDetail/index.vue +12 -8
- package/dist/v3/JsonPretty/components/Brackets/index.vue +1 -0
- package/dist/v3/JsonPretty/components/Carets/index.vue +2 -1
- package/dist/v3/JsonPretty/components/CheckController/index.vue +26 -15
- package/dist/v3/JsonPretty/components/TreeNode/index.vue +42 -20
- package/dist/v3/JsonPretty/index.vue +60 -37
- package/dist/v3/JsonPretty/utils/index.ts +41 -44
- package/dist/v3/MovableContainer/index.vue +89 -0
- package/dist/v3/NFCList/NFCItem.vue +14 -14
- package/dist/v3/NFCList/NFCTool.vue +99 -81
- package/dist/v3/NFCList/index.vue +14 -10
- package/dist/v3/NetworkList/InterceptConfig.vue +154 -364
- package/dist/v3/NetworkList/InterceptItem.vue +14 -6
- package/dist/v3/NetworkList/NetworkDetail.vue +34 -29
- package/dist/v3/NetworkList/NetworkIntercept.vue +11 -8
- package/dist/v3/NetworkList/NetworkItem.vue +27 -11
- package/dist/v3/NetworkList/NetworkSend.vue +132 -290
- package/dist/v3/NetworkList/hooks/useNetworkForm.ts +86 -0
- package/dist/v3/NetworkList/index.vue +32 -24
- package/dist/v3/NetworkList/utils.ts +101 -0
- package/dist/v3/Performance/index.vue +495 -0
- package/dist/v3/Performance/modules/PerformanceMetrics.vue +153 -0
- package/dist/v3/Performance/modules/PerformanceWidget.vue +249 -0
- package/dist/v3/Performance/modules/usePerformanceChart.ts +460 -0
- package/dist/v3/Performance/modules/usePerformanceData.ts +258 -0
- package/dist/v3/Pick/index.vue +322 -0
- package/dist/v3/PiniaList/index.vue +38 -17
- package/dist/v3/RouteList/index.vue +32 -15
- package/dist/v3/RunJS/index.vue +30 -10
- package/dist/v3/ScanCodeList/ScanCodeItem.vue +2 -9
- package/dist/v3/ScanCodeList/index.vue +12 -9
- package/dist/v3/SettingButton/index.vue +45 -0
- package/dist/v3/SettingList/index.css +120 -0
- package/dist/v3/SettingList/index.vue +96 -537
- package/dist/v3/SettingList/modules/SettingDevTool.vue +208 -0
- package/dist/v3/SettingList/modules/SettingInfo.vue +119 -0
- package/dist/v3/SettingList/modules/SettingLanguage.vue +74 -0
- package/dist/v3/SettingList/modules/SettingLog.vue +230 -0
- package/dist/v3/SettingList/modules/SettingNetwork.vue +120 -0
- package/dist/v3/SettingList/modules/SettingTheme.vue +312 -0
- package/dist/v3/SourceCode/Line.vue +15 -2
- package/dist/v3/SourceCode/index.vue +25 -24
- package/dist/v3/SourceCode/parseCode.ts +114 -56
- package/dist/v3/StorageList/index.vue +33 -33
- package/dist/v3/Tabs/index.vue +31 -28
- package/dist/v3/Tag/index.vue +39 -20
- package/dist/v3/TransferList/TransferDetail.vue +268 -0
- package/dist/v3/TransferList/TransferItem.vue +125 -0
- package/dist/v3/TransferList/index.vue +181 -0
- package/dist/v3/UniEvent/UniEventItem.vue +1 -0
- package/dist/v3/UniEvent/index.vue +28 -29
- package/dist/v3/{VirtualListPro → VirtualList}/AutoSize.vue +1 -1
- package/dist/v3/VirtualList/index.vue +382 -82
- package/dist/v3/VuexList/index.vue +38 -17
- package/dist/v3/WebSocket/WebSocketDetail.vue +142 -80
- package/dist/v3/WebSocket/WebSocketItem.vue +10 -4
- package/dist/v3/WebSocket/index.vue +44 -30
- package/dist/v3/hooks/useNFC/index.ts +6 -6
- package/dist/v3/hooks/useNFC/typing.d.ts +2 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +215 -626
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +54 -85
- package/dist/v3/hooks/useNFC/utils.ts +3 -3
- package/dist/v3/hooks/useRequest/index.ts +2 -2
- package/dist/v3/hooks/useScanCode/index.ts +10 -8
- package/dist/v3/styles/theme.css +290 -0
- package/dist/v3/styles/theme.ts +12 -0
- package/package.json +25 -5
- package/dist/devConsole/index.d.ts.map +0 -1
- package/dist/devConsole/index.js +0 -273
- package/dist/devEvent/index.d.ts +0 -328
- package/dist/devEvent/index.d.ts.map +0 -1
- package/dist/devEvent/index.js +0 -697
- package/dist/devEventBus/index.d.ts +0 -42
- package/dist/devEventBus/index.d.ts.map +0 -1
- package/dist/devEventBus/index.js +0 -70
- package/dist/devIntercept/index.d.ts +0 -281
- package/dist/devIntercept/index.d.ts.map +0 -1
- package/dist/devIntercept/index.js +0 -949
- package/dist/devRunJS/index.d.ts +0 -67
- package/dist/devRunJS/index.d.ts.map +0 -1
- package/dist/devStore/index.d.ts +0 -199
- package/dist/devStore/index.d.ts.map +0 -1
- package/dist/devStore/index.js +0 -562
- package/dist/devToolInfo/index.d.ts +0 -17
- package/dist/devToolInfo/index.d.ts.map +0 -1
- package/dist/devToolInfo/index.js +0 -15
- package/dist/v3/AutoSizer/utils.d.ts +0 -5
- package/dist/v3/AutoSizer/utils.d.ts.map +0 -1
- package/dist/v3/ConsoleList/staticTips.d.ts +0 -13
- package/dist/v3/ConsoleList/staticTips.d.ts.map +0 -1
- package/dist/v3/DevToolWindow/const.d.ts +0 -46
- package/dist/v3/DevToolWindow/const.d.ts.map +0 -1
- package/dist/v3/InstanceTree/components/InstanceTreeNode.vue +0 -81
- package/dist/v3/InstanceTree/flatten.d.ts +0 -10
- package/dist/v3/InstanceTree/flatten.d.ts.map +0 -1
- package/dist/v3/InstanceTree/flatten.ts +0 -75
- package/dist/v3/InstanceTree/index.vue +0 -51
- package/dist/v3/InstanceTree/transformTree.d.ts +0 -17
- package/dist/v3/InstanceTree/transformTree.d.ts.map +0 -1
- package/dist/v3/InstanceTree/transformTree.ts +0 -237
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +0 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +0 -1
- package/dist/v3/JsonPretty/hooks/useError.d.ts +0 -8
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +0 -1
- package/dist/v3/JsonPretty/type.d.ts +0 -94
- package/dist/v3/JsonPretty/type.d.ts.map +0 -1
- package/dist/v3/JsonPretty/utils/index.d.ts +0 -10
- package/dist/v3/JsonPretty/utils/index.d.ts.map +0 -1
- package/dist/v3/NFCList/const.d.ts +0 -13
- package/dist/v3/NFCList/const.d.ts.map +0 -1
- package/dist/v3/NetworkList/const.d.ts +0 -5
- package/dist/v3/NetworkList/const.d.ts.map +0 -1
- package/dist/v3/SourceCode/parseCode.d.ts +0 -27
- package/dist/v3/SourceCode/parseCode.d.ts.map +0 -1
- package/dist/v3/UploadList/UploadDetail.vue +0 -255
- package/dist/v3/UploadList/UploadItem.vue +0 -122
- package/dist/v3/UploadList/index.vue +0 -125
- package/dist/v3/VirtualListPro/index.vue +0 -229
- package/dist/v3/hooks/useContainerStyle.d.ts +0 -15
- package/dist/v3/hooks/useContainerStyle.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/index.d.ts +0 -5
- package/dist/v3/hooks/useNFC/index.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/utils.d.ts +0 -95
- package/dist/v3/hooks/useNFC/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/index.d.ts +0 -126
- package/dist/v3/hooks/useRequest/index.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/utils.d.ts +0 -35
- package/dist/v3/hooks/useRequest/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useScanCode/index.d.ts +0 -36
- package/dist/v3/hooks/useScanCode/index.d.ts.map +0 -1
- /package/dist/v3/{VirtualListPro → VirtualList}/readme.md +0 -0
package/dist/utils/file.js
CHANGED
|
@@ -1,85 +1 @@
|
|
|
1
|
-
function c() {
|
|
2
|
-
return new Promise((n, t) => {
|
|
3
|
-
plus ? plus.io.resolveLocalFileSystemURL("_downloads", function(o) {
|
|
4
|
-
n(o.fullPath);
|
|
5
|
-
}) : t();
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
function a(n, t) {
|
|
9
|
-
plus.io.requestFileSystem(
|
|
10
|
-
plus.io.PUBLIC_DOCUMENTS,
|
|
11
|
-
function(o) {
|
|
12
|
-
var i;
|
|
13
|
-
(i = o.root) == null || i.getFile(
|
|
14
|
-
n,
|
|
15
|
-
{ create: !0 },
|
|
16
|
-
function(e) {
|
|
17
|
-
e.createWriter(function(l) {
|
|
18
|
-
l.onwriteend = function() {
|
|
19
|
-
console.log("[DevTool] 写入文件成功" + n), uni.showToast({
|
|
20
|
-
icon: "none",
|
|
21
|
-
title: "写入文件成功" + n,
|
|
22
|
-
duration: 10 * 1e3
|
|
23
|
-
});
|
|
24
|
-
}, l.onerror = function(s) {
|
|
25
|
-
console.log("[DevTool] 写入文件失败" + JSON.stringify(s)), uni.showToast({
|
|
26
|
-
icon: "none",
|
|
27
|
-
title: "写入文件失败"
|
|
28
|
-
});
|
|
29
|
-
}, l.write(t);
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
function(e) {
|
|
33
|
-
uni.showToast({
|
|
34
|
-
icon: "none",
|
|
35
|
-
title: "获取文件失败"
|
|
36
|
-
}), console.log("[DevTool] 获取文件失败" + JSON.stringify(e));
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
},
|
|
40
|
-
function(o) {
|
|
41
|
-
uni.showToast({
|
|
42
|
-
icon: "none",
|
|
43
|
-
title: "获取文件系统失败"
|
|
44
|
-
}), console.log("[DevTool] 获取文件系统失败" + JSON.stringify(o));
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
async function u(n, t) {
|
|
49
|
-
try {
|
|
50
|
-
const o = await c() + `${Date.now()}_${t}.txt`;
|
|
51
|
-
a(o, n);
|
|
52
|
-
} catch (o) {
|
|
53
|
-
console.log("[DevTool] " + JSON.stringify(o));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
async function r(n, t) {
|
|
57
|
-
const o = new Blob([n], { type: "text/plain" }), i = URL.createObjectURL(o), e = document.createElement("a");
|
|
58
|
-
e.href = i, e.download = t, e.click();
|
|
59
|
-
}
|
|
60
|
-
async function f(n, t) {
|
|
61
|
-
var l;
|
|
62
|
-
const o = uni.getFileSystemManager(), i = `${t}_${Date.now()}.txt`, e = `${((l = uni == null ? void 0 : uni.env) == null ? void 0 : l.USER_DATA_PATH) ?? "Download"}/${i}`;
|
|
63
|
-
o.writeFile({
|
|
64
|
-
data: n,
|
|
65
|
-
filePath: e,
|
|
66
|
-
success: (s) => {
|
|
67
|
-
console.log("[DevTool] 写入文件成功" + e), uni.showToast({
|
|
68
|
-
title: "写入文件成功" + e,
|
|
69
|
-
icon: "none"
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
fail: (s) => {
|
|
73
|
-
console.log("[DevTool] 写入文件失败" + JSON.stringify(s)), uni.showToast({
|
|
74
|
-
title: "写入文件失败" + JSON.stringify(s),
|
|
75
|
-
icon: "none"
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
c as getFilePath,
|
|
82
|
-
r as saveTextFileH5,
|
|
83
|
-
f as saveTextFileMicro,
|
|
84
|
-
u as saveTxtFileApp
|
|
85
|
-
};
|
|
1
|
+
function c(){return new Promise((n,t)=>{plus?plus.io.resolveLocalFileSystemURL("_downloads",function(o){n(o.fullPath)}):t()})}function a(n,t){plus.io.requestFileSystem(plus.io.PUBLIC_DOCUMENTS,function(o){var i;(i=o.root)==null||i.getFile(n,{create:!0},function(e){e.createWriter(function(l){l.onwriteend=function(){console.log("[DevTool] 写入文件成功"+n),uni.showToast({icon:"none",title:"写入文件成功"+n,duration:10*1e3})},l.onerror=function(s){console.log("[DevTool] 写入文件失败"+JSON.stringify(s)),uni.showToast({icon:"none",title:"写入文件失败"})},l.write(t)})},function(e){uni.showToast({icon:"none",title:"获取文件失败"}),console.log("[DevTool] 获取文件失败"+JSON.stringify(e))})},function(o){uni.showToast({icon:"none",title:"获取文件系统失败"}),console.log("[DevTool] 获取文件系统失败"+JSON.stringify(o))})}async function u(n,t){try{const o=await c()+`${Date.now()}_${t}.txt`;a(o,n)}catch(o){console.log("[DevTool] "+JSON.stringify(o))}}async function r(n,t){const o=new Blob([n],{type:"text/plain"}),i=URL.createObjectURL(o),e=document.createElement("a");e.href=i,e.download=t,e.click()}async function f(n,t){var l;const o=uni.getFileSystemManager(),i=`${t}_${Date.now()}.txt`,e=`${((l=uni==null?void 0:uni.env)==null?void 0:l.USER_DATA_PATH)??"Download"}/${i}`;o.writeFile({data:n,filePath:e,success:s=>{console.log("[DevTool] 写入文件成功"+e),uni.showToast({title:"写入文件成功"+e,icon:"none"})},fail:s=>{console.log("[DevTool] 写入文件失败"+JSON.stringify(s)),uni.showToast({title:"写入文件失败"+JSON.stringify(s),icon:"none"})}})}export{c as getFilePath,r as saveTextFileH5,f as saveTextFileMicro,u as saveTxtFileApp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function I(s,u,p={}){let i=null,c=null,e=null,o,r=null;const{leading:m=!0,trailing:d=!0}=p,a=n=>{const t=c,l=e;return c=e=null,r=n,o=s.apply(l,t),o},T=n=>(r=n,i=null,m?a(n):void 0),A=n=>(i=null,c&&d?a(n):(c=e=null,o)),v=n=>{if(r===null)return u;const t=n-r;return u-t},k=n=>{if(r===null)return!0;const t=n-r;return t>=u||t<0},h=()=>{const n=Date.now();if(k(n))return A(n);i=setTimeout(h,v(n))},g=function(...n){const t=Date.now(),l=k(t);return c=n,e=this,l&&i===null?T(t):(i===null&&(i=setTimeout(h,u)),o)};return g.cancel=()=>{i!==null&&clearTimeout(i),r=null,i=c=e=null},g}function y(s,u,p={}){const{leading:i=!1,trailing:c=!0}=p;let e=null,o=null,r=null,m,d=null,a=0;const T=t=>{const l=o,f=r;return o=r=null,a=t,m=s.apply(f,l),m},A=t=>(a=t,c&&(e=setTimeout(g,u)),i?T(t):void 0),v=t=>(e=null,c&&o?T(t):(o=r=null,m)),k=t=>{const l=t-(d||0),f=t-a,S=u-l;return Math.min(S,u-f)},h=t=>{const l=t-(d||0),f=t-a;return d===null?i&&f<u:l>=u||f>=u},g=()=>{const t=Date.now();h(t)?v(t):e&&(e=setTimeout(g,k(t)))},n=function(...t){const l=Date.now(),f=h(l);if(o=t,r=this,d=l,f){if(e===null)return A(l);if(e&&(clearTimeout(e),e=setTimeout(g,u),i))return T(l)}else e||(e=setTimeout(g,u));return m};return n.cancel=()=>{e!==null&&(clearTimeout(e),e=null,o=r=null,d=a=0)},n.flush=()=>{if(e!==null){const t=Date.now();return v(t)}return m},n}function C(s){return typeof requestAnimationFrame<"u"?requestAnimationFrame(s):setTimeout(s,16)}function E(s){typeof cancelAnimationFrame<"u"?cancelAnimationFrame(s):clearTimeout(s)}exports.caf=E;exports.debounce=y;exports.raf=C;exports.throttle=I;
|
package/dist/utils/function.d.ts
CHANGED
|
@@ -31,5 +31,18 @@ type DebouncedFunction<T extends (...args: any[]) => any> = ((...args: Parameter
|
|
|
31
31
|
* @returns 防抖后的函数
|
|
32
32
|
*/
|
|
33
33
|
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number, options?: DebounceOptions): DebouncedFunction<T>;
|
|
34
|
+
/**
|
|
35
|
+
* 跨平台的 requestAnimationFrame 封装
|
|
36
|
+
* 在不支持 requestAnimationFrame 的环境中降级为 setTimeout
|
|
37
|
+
* @param fn 需要在下一帧执行的回调函数
|
|
38
|
+
* @returns 定时器 ID,可用于 caf 取消
|
|
39
|
+
*/
|
|
40
|
+
export declare function raf(fn: FrameRequestCallback): number;
|
|
41
|
+
/**
|
|
42
|
+
* 跨平台的 cancelAnimationFrame 封装
|
|
43
|
+
* 与 raf 配套使用,用于取消待执行的动画帧
|
|
44
|
+
* @param timer raf 返回的定时器 ID
|
|
45
|
+
*/
|
|
46
|
+
export declare function caf(timer: number): void;
|
|
34
47
|
export {};
|
|
35
48
|
//# sourceMappingURL=function.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/utils/function.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAmFvD;AAED,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,CAC3D,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KACnB,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG;IAChC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,iBAAiB,CAAC,CAAC,CAAC,CAwItB;AAED;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,EAAE,EAAE,oBAAoB,GAAG,MAAM,CAKpD;AAED;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAMvC"}
|
package/dist/utils/function.js
CHANGED
|
@@ -1,68 +1 @@
|
|
|
1
|
-
function
|
|
2
|
-
let r = null, o = null, n = null, s, i = null;
|
|
3
|
-
const { leading: f = !0, trailing: m = !0 } = p, c = (e) => {
|
|
4
|
-
const t = o, l = n;
|
|
5
|
-
return o = n = null, i = e, s = k.apply(l, t), s;
|
|
6
|
-
}, d = (e) => (i = e, r = null, f ? c(e) : void 0), I = (e) => (r = null, o && m ? c(e) : (o = n = null, s)), T = (e) => {
|
|
7
|
-
if (i === null)
|
|
8
|
-
return u;
|
|
9
|
-
const t = e - i;
|
|
10
|
-
return u - t;
|
|
11
|
-
}, v = (e) => {
|
|
12
|
-
if (i === null)
|
|
13
|
-
return !0;
|
|
14
|
-
const t = e - i;
|
|
15
|
-
return t >= u || t < 0;
|
|
16
|
-
}, h = () => {
|
|
17
|
-
const e = Date.now();
|
|
18
|
-
if (v(e))
|
|
19
|
-
return I(e);
|
|
20
|
-
r = setTimeout(h, T(e));
|
|
21
|
-
}, g = function(...e) {
|
|
22
|
-
const t = Date.now(), l = v(t);
|
|
23
|
-
return o = e, n = this, l && r === null ? d(t) : (r === null && (r = setTimeout(h, u)), s);
|
|
24
|
-
};
|
|
25
|
-
return g.cancel = () => {
|
|
26
|
-
r !== null && clearTimeout(r), i = null, r = o = n = null;
|
|
27
|
-
}, g;
|
|
28
|
-
}
|
|
29
|
-
function L(k, u, p = {}) {
|
|
30
|
-
const { leading: r = !1, trailing: o = !0 } = p;
|
|
31
|
-
let n = null, s = null, i = null, f, m = null, c = 0;
|
|
32
|
-
const d = (t) => {
|
|
33
|
-
const l = s, a = i;
|
|
34
|
-
return s = i = null, c = t, f = k.apply(a, l), f;
|
|
35
|
-
}, I = (t) => (c = t, o && (n = setTimeout(g, u)), r ? d(t) : void 0), T = (t) => (n = null, o && s ? d(t) : (s = i = null, f)), v = (t) => {
|
|
36
|
-
const l = t - (m || 0), a = t - c, C = u - l;
|
|
37
|
-
return Math.min(C, u - a);
|
|
38
|
-
}, h = (t) => {
|
|
39
|
-
const l = t - (m || 0), a = t - c;
|
|
40
|
-
return m === null ? r && a < u : l >= u || a >= u;
|
|
41
|
-
}, g = () => {
|
|
42
|
-
const t = Date.now();
|
|
43
|
-
h(t) ? T(t) : n && (n = setTimeout(g, v(t)));
|
|
44
|
-
}, e = function(...t) {
|
|
45
|
-
const l = Date.now(), a = h(l);
|
|
46
|
-
if (s = t, i = this, m = l, a) {
|
|
47
|
-
if (n === null)
|
|
48
|
-
return I(l);
|
|
49
|
-
if (n && (clearTimeout(n), n = setTimeout(g, u), r))
|
|
50
|
-
return d(l);
|
|
51
|
-
} else
|
|
52
|
-
n || (n = setTimeout(g, u));
|
|
53
|
-
return f;
|
|
54
|
-
};
|
|
55
|
-
return e.cancel = () => {
|
|
56
|
-
n !== null && (clearTimeout(n), n = null, s = i = null, m = c = 0);
|
|
57
|
-
}, e.flush = () => {
|
|
58
|
-
if (n !== null) {
|
|
59
|
-
const t = Date.now();
|
|
60
|
-
return T(t);
|
|
61
|
-
}
|
|
62
|
-
return f;
|
|
63
|
-
}, e;
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
L as debounce,
|
|
67
|
-
E as throttle
|
|
68
|
-
};
|
|
1
|
+
function C(s,u,p={}){let i=null,c=null,t=null,o,r=null;const{leading:m=!0,trailing:d=!0}=p,a=e=>{const n=c,l=t;return c=t=null,r=e,o=s.apply(l,n),o},T=e=>(r=e,i=null,m?a(e):void 0),A=e=>(i=null,c&&d?a(e):(c=t=null,o)),v=e=>{if(r===null)return u;const n=e-r;return u-n},k=e=>{if(r===null)return!0;const n=e-r;return n>=u||n<0},h=()=>{const e=Date.now();if(k(e))return A(e);i=setTimeout(h,v(e))},g=function(...e){const n=Date.now(),l=k(n);return c=e,t=this,l&&i===null?T(n):(i===null&&(i=setTimeout(h,u)),o)};return g.cancel=()=>{i!==null&&clearTimeout(i),r=null,i=c=t=null},g}function E(s,u,p={}){const{leading:i=!1,trailing:c=!0}=p;let t=null,o=null,r=null,m,d=null,a=0;const T=n=>{const l=o,f=r;return o=r=null,a=n,m=s.apply(f,l),m},A=n=>(a=n,c&&(t=setTimeout(g,u)),i?T(n):void 0),v=n=>(t=null,c&&o?T(n):(o=r=null,m)),k=n=>{const l=n-(d||0),f=n-a,I=u-l;return Math.min(I,u-f)},h=n=>{const l=n-(d||0),f=n-a;return d===null?i&&f<u:l>=u||f>=u},g=()=>{const n=Date.now();h(n)?v(n):t&&(t=setTimeout(g,k(n)))},e=function(...n){const l=Date.now(),f=h(l);if(o=n,r=this,d=l,f){if(t===null)return A(l);if(t&&(clearTimeout(t),t=setTimeout(g,u),i))return T(l)}else t||(t=setTimeout(g,u));return m};return e.cancel=()=>{t!==null&&(clearTimeout(t),t=null,o=r=null,d=a=0)},e.flush=()=>{if(t!==null){const n=Date.now();return v(n)}return m},e}function F(s){return typeof requestAnimationFrame<"u"?requestAnimationFrame(s):setTimeout(s,16)}function L(s){typeof cancelAnimationFrame<"u"?cancelAnimationFrame(s):clearTimeout(s)}export{L as caf,E as debounce,F as raf,C as throttle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./language.cjs"),i=require("./object.cjs"),r=require("./function.cjs"),a=require("./file.cjs"),l=require("./page.cjs"),s=require("./date.cjs"),t=require("./string.cjs"),o=require("./ip.cjs"),n=require("./platform.cjs"),u=require("./array.cjs"),c=require("./openLink.cjs");exports.getValueType=e.getValueType;exports.isArray=e.isArray;exports.isBoolean=e.isBoolean;exports.isFunction=e.isFunction;exports.isImage=e.isImage;exports.isNil=e.isNil;exports.isNull=e.isNull;exports.isNumber=e.isNumber;exports.isObject=e.isObject;exports.isString=e.isString;exports.isSymbol=e.isSymbol;exports.isUndefined=e.isUndefined;exports.transformValueToShortString=e.transformValueToShortString;exports.transformValueToView=e.transformValueToView;exports.calculateObjectSize=i.calculateObjectSize;exports.formatStorageSize=i.formatStorageSize;exports.getValueByPath=i.getValueByPath;exports.omit=i.omit;exports.parseValue=i.parseValue;exports.pick=i.pick;exports.serializeCircular=i.serializeCircular;exports.setValueByPath=i.setValueByPath;exports.caf=r.caf;exports.debounce=r.debounce;exports.raf=r.raf;exports.throttle=r.throttle;exports.getFilePath=a.getFilePath;exports.saveTextFileH5=a.saveTextFileH5;exports.saveTextFileMicro=a.saveTextFileMicro;exports.saveTxtFileApp=a.saveTxtFileApp;exports.getCurrentPagePath=l.getCurrentPagePath;exports.formatDate=s.formatDate;exports.formatDuration=s.formatDuration;exports.getCurrentDate=s.getCurrentDate;exports.sleep=s.sleep;exports.escapeHTML=t.escapeHTML;exports.extractRowAndCol=t.extractRowAndCol;exports.extractUrl=t.extractUrl;exports.hasUrl=t.hasUrl;exports.hightLight=t.hightLight;exports.isMockWX=t.isMockWX;exports.parseStock=t.parseStock;exports.splitStrByUrl=t.splitStrByUrl;exports.uniqueId=t.uniqueId;exports.getDeviceMac=o.getDeviceMac;exports.getLanIp=o.getLanIp;exports.getMicroAppIp=o.getMicroAppIp;exports.getWifiIp=o.getWifiIp;exports.isAndroid=n.isAndroid;exports.isH5=n.isH5;exports.isWX=n.isWX;exports.chunk=u.chunk;exports.openOutLink=c.openOutLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,cAAc,UAAU,CAAC;AAEzB,cAAc,YAAY,CAAC;AAE3B,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AAEvB,cAAc,UAAU,CAAC;AAEzB,cAAc,MAAM,CAAC;AAErB,cAAc,YAAY,CAAC;AAE3B,cAAc,SAAS,CAAC;AAExB,cAAc,YAAY,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { calculateObjectSize as h, formatStorageSize as S, getValueByPath as d, omit as T, parseValue as V, pick as y, serializeCircular as b, setValueByPath as k } from "./object.js";
|
|
3
|
-
import { debounce as F, throttle as M } from "./function.js";
|
|
4
|
-
import { getFilePath as v, saveTextFileH5 as B, saveTextFileMicro as C, saveTxtFileApp as D } from "./file.js";
|
|
5
|
-
import { getCurrentPagePath as L } from "./page.js";
|
|
6
|
-
import { formatDate as z, formatDuration as H, getCurrentDate as N, sleep as O } from "./date.js";
|
|
7
|
-
import { escapeHTML as j, extractRowAndCol as w, extractUrl as X, hasUrl as q, hightLight as R, isMockWX as E, parseStock as G, splitStrByUrl as J, uniqueId as K } from "./string.js";
|
|
8
|
-
import { getDeviceMac as Y, getLanIp as Z, getMicroAppIp as _, getWifiIp as $ } from "./ip.js";
|
|
9
|
-
import { isAndroid as te, isH5 as re, isWX as oe } from "./platform.js";
|
|
10
|
-
import { chunk as ae } from "./array.js";
|
|
11
|
-
import { openOutLink as le } from "./openLink.js";
|
|
12
|
-
export {
|
|
13
|
-
h as calculateObjectSize,
|
|
14
|
-
ae as chunk,
|
|
15
|
-
F as debounce,
|
|
16
|
-
j as escapeHTML,
|
|
17
|
-
w as extractRowAndCol,
|
|
18
|
-
X as extractUrl,
|
|
19
|
-
z as formatDate,
|
|
20
|
-
H as formatDuration,
|
|
21
|
-
S as formatStorageSize,
|
|
22
|
-
N as getCurrentDate,
|
|
23
|
-
L as getCurrentPagePath,
|
|
24
|
-
Y as getDeviceMac,
|
|
25
|
-
v as getFilePath,
|
|
26
|
-
Z as getLanIp,
|
|
27
|
-
_ as getMicroAppIp,
|
|
28
|
-
d as getValueByPath,
|
|
29
|
-
r as getValueType,
|
|
30
|
-
$ as getWifiIp,
|
|
31
|
-
q as hasUrl,
|
|
32
|
-
R as hightLight,
|
|
33
|
-
te as isAndroid,
|
|
34
|
-
o as isArray,
|
|
35
|
-
i as isBoolean,
|
|
36
|
-
a as isFunction,
|
|
37
|
-
re as isH5,
|
|
38
|
-
E as isMockWX,
|
|
39
|
-
s as isNil,
|
|
40
|
-
l as isNull,
|
|
41
|
-
p as isNumber,
|
|
42
|
-
n as isObject,
|
|
43
|
-
m as isString,
|
|
44
|
-
u as isSymbol,
|
|
45
|
-
c as isUndefined,
|
|
46
|
-
oe as isWX,
|
|
47
|
-
T as omit,
|
|
48
|
-
le as openOutLink,
|
|
49
|
-
G as parseStock,
|
|
50
|
-
V as parseValue,
|
|
51
|
-
y as pick,
|
|
52
|
-
B as saveTextFileH5,
|
|
53
|
-
C as saveTextFileMicro,
|
|
54
|
-
D as saveTxtFileApp,
|
|
55
|
-
b as serializeCircular,
|
|
56
|
-
k as setValueByPath,
|
|
57
|
-
O as sleep,
|
|
58
|
-
J as splitStrByUrl,
|
|
59
|
-
M as throttle,
|
|
60
|
-
f as transformValueToShortString,
|
|
61
|
-
x as transformValueToView,
|
|
62
|
-
K as uniqueId
|
|
63
|
-
};
|
|
1
|
+
import{getValueType as r,isArray as o,isBoolean as i,isFunction as a,isImage as s,isNil as l,isNull as p,isNumber as f,isObject as m,isString as n,isSymbol as c,isUndefined as u,transformValueToShortString as g,transformValueToView as x}from"./language.js";import{calculateObjectSize as S,formatStorageSize as d,getValueByPath as T,omit as V,parseValue as y,pick as b,serializeCircular as k,setValueByPath as A}from"./object.js";import{caf as I,debounce as M,raf as P,throttle as v}from"./function.js";import{getFilePath as C,saveTextFileH5 as D,saveTextFileMicro as L,saveTxtFileApp as U}from"./file.js";import{getCurrentPagePath as H}from"./page.js";import{formatDate as O,formatDuration as W,getCurrentDate as j,sleep as w}from"./date.js";import{escapeHTML as q,extractRowAndCol as R,extractUrl as E,hasUrl as G,hightLight as J,isMockWX as K,parseStock as Q,splitStrByUrl as Y,uniqueId as Z}from"./string.js";import{getDeviceMac as $,getLanIp as ee,getMicroAppIp as te,getWifiIp as re}from"./ip.js";import{isAndroid as ie,isH5 as ae,isWX as se}from"./platform.js";import{chunk as pe}from"./array.js";import{openOutLink as me}from"./openLink.js";export{I as caf,S as calculateObjectSize,pe as chunk,M as debounce,q as escapeHTML,R as extractRowAndCol,E as extractUrl,O as formatDate,W as formatDuration,d as formatStorageSize,j as getCurrentDate,H as getCurrentPagePath,$ as getDeviceMac,C as getFilePath,ee as getLanIp,te as getMicroAppIp,T as getValueByPath,r as getValueType,re as getWifiIp,G as hasUrl,J as hightLight,ie as isAndroid,o as isArray,i as isBoolean,a as isFunction,ae as isH5,s as isImage,K as isMockWX,l as isNil,p as isNull,f as isNumber,m as isObject,n as isString,c as isSymbol,u as isUndefined,se as isWX,V as omit,me as openOutLink,Q as parseStock,y as parseValue,b as pick,P as raf,D as saveTextFileH5,L as saveTextFileMicro,U as saveTxtFileApp,k as serializeCircular,A as setValueByPath,w as sleep,Y as splitStrByUrl,v as throttle,g as transformValueToShortString,x as transformValueToView,Z as uniqueId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(){if(uni.__dev_tool_platform__==="app"){const t=plus.android.runtimeMainActivity(),e=plus.android.importClass("android.content.Context");plus.android.importClass("android.net.wifi.WifiManager"),plus.android.importClass("android.net.wifi.WifiInfo"),plus.android.importClass("android.net.wifi.ScanResult");const n=t.getSystemService(e.WIFI_SERVICE).getConnectionInfo().getIpAddress();return(n&255)+"."+(n>>8&255)+"."+(n>>16&255)+"."+(n>>24&255)}return""}function d(){var t,e;if(uni.__dev_tool_platform__==="app"){const a=plus.android.runtimeMainActivity(),r=plus.android.importClass("android.content.Context");plus.android.importClass("android.net.ConnectivityManager");const n=a.getSystemService(r.CONNECTIVITY_SERVICE),i=n.getLinkProperties(n.getActiveNetwork()),o=plus.android.invoke(i,"getLinkAddress"),s=o==null?void 0:o.toString(),c=s==null?void 0:s.split(",");return(e=(t=c==null?void 0:c[1])==null?void 0:t.split("/"))==null?void 0:e[0]}return""}function l(){return new Promise(t=>{uni.__dev_tool_platform__==="mp-weixin"&&uni.getLocalIPAddress({success:e=>{t(e.localip)},fail:()=>{t("")}}),t("")})}function f(){let t="";const r=plus.android.importClass("java.net.NetworkInterface").getByName("wlan0").getHardwareAddress();for(let n=0;n<r.length;n++){let i="";const o=r[n];o<0?i=(255+o+1).toString(16):i=o.toString(16),i.length==1&&(i="0"+i),t+=i}return t}exports.getDeviceMac=f;exports.getLanIp=d;exports.getMicroAppIp=l;exports.getWifiIp=p;
|
package/dist/utils/ip.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function getWifiIp(): string;
|
|
2
2
|
export declare function getLanIp(): any;
|
|
3
3
|
export declare function getMicroAppIp(): Promise<unknown>;
|
|
4
|
-
export declare function getDeviceMac():
|
|
4
|
+
export declare function getDeviceMac(): string;
|
|
5
5
|
//# sourceMappingURL=ip.d.ts.map
|
package/dist/utils/ip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ip.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"ip.d.ts","sourceRoot":"","sources":["../../src/utils/ip.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,WAsBxB;AAED,wBAAgB,QAAQ,QAiBvB;AAED,wBAAgB,aAAa,qBAc5B;AAED,wBAAgB,YAAY,WAoB3B"}
|
package/dist/utils/ip.js
CHANGED
|
@@ -1,45 +1 @@
|
|
|
1
|
-
function l() {
|
|
2
|
-
if (uni.__dev_tool_platform__ === "app") {
|
|
3
|
-
const t = plus.android.runtimeMainActivity(), i = plus.android.importClass("android.content.Context");
|
|
4
|
-
plus.android.importClass("android.net.wifi.WifiManager"), plus.android.importClass("android.net.wifi.WifiInfo"), plus.android.importClass("android.net.wifi.ScanResult");
|
|
5
|
-
const n = t.getSystemService(i.WIFI_SERVICE).getConnectionInfo().getIpAddress();
|
|
6
|
-
return (n & 255) + "." + (n >> 8 & 255) + "." + (n >> 16 & 255) + "." + (n >> 24 & 255);
|
|
7
|
-
}
|
|
8
|
-
return "";
|
|
9
|
-
}
|
|
10
|
-
function p() {
|
|
11
|
-
var t, i;
|
|
12
|
-
if (uni.__dev_tool_platform__ === "app") {
|
|
13
|
-
const a = plus.android.runtimeMainActivity(), r = plus.android.importClass("android.content.Context");
|
|
14
|
-
plus.android.importClass("android.net.ConnectivityManager");
|
|
15
|
-
const n = a.getSystemService(
|
|
16
|
-
r.CONNECTIVITY_SERVICE
|
|
17
|
-
), o = n.getLinkProperties(n.getActiveNetwork()), e = plus.android.invoke(o, "getLinkAddress"), s = e == null ? void 0 : e.toString(), c = s == null ? void 0 : s.split(",");
|
|
18
|
-
return (i = (t = c == null ? void 0 : c[1]) == null ? void 0 : t.split("/")) == null ? void 0 : i[0];
|
|
19
|
-
}
|
|
20
|
-
return "";
|
|
21
|
-
}
|
|
22
|
-
function f() {
|
|
23
|
-
return new Promise((t) => {
|
|
24
|
-
uni.__dev_tool_platform__ === "mp-weixin" && uni.getLocalIPAddress({
|
|
25
|
-
success: (i) => {
|
|
26
|
-
t(i.localip);
|
|
27
|
-
},
|
|
28
|
-
fail: (i) => {
|
|
29
|
-
t("");
|
|
30
|
-
}
|
|
31
|
-
}), t("");
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function u() {
|
|
35
|
-
for (var t = "", i = plus.android.importClass("java.net.NetworkInterface"), a = i.getByName("wlan0"), r = a.getHardwareAddress(), n = 0; n < r.length; n++) {
|
|
36
|
-
var o = "", e = r[n];
|
|
37
|
-
e < 0 ? o = (255 + e + 1).toString(16) : o = e.toString(16), o.length == 1 && (o = "0" + o), t += o;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
u as getDeviceMac,
|
|
42
|
-
p as getLanIp,
|
|
43
|
-
f as getMicroAppIp,
|
|
44
|
-
l as getWifiIp
|
|
45
|
-
};
|
|
1
|
+
function p(){if(uni.__dev_tool_platform__==="app"){const t=plus.android.runtimeMainActivity(),o=plus.android.importClass("android.content.Context");plus.android.importClass("android.net.wifi.WifiManager"),plus.android.importClass("android.net.wifi.WifiInfo"),plus.android.importClass("android.net.wifi.ScanResult");const n=t.getSystemService(o.WIFI_SERVICE).getConnectionInfo().getIpAddress();return(n&255)+"."+(n>>8&255)+"."+(n>>16&255)+"."+(n>>24&255)}return""}function l(){var t,o;if(uni.__dev_tool_platform__==="app"){const a=plus.android.runtimeMainActivity(),r=plus.android.importClass("android.content.Context");plus.android.importClass("android.net.ConnectivityManager");const n=a.getSystemService(r.CONNECTIVITY_SERVICE),i=n.getLinkProperties(n.getActiveNetwork()),e=plus.android.invoke(i,"getLinkAddress"),s=e==null?void 0:e.toString(),c=s==null?void 0:s.split(",");return(o=(t=c==null?void 0:c[1])==null?void 0:t.split("/"))==null?void 0:o[0]}return""}function f(){return new Promise(t=>{uni.__dev_tool_platform__==="mp-weixin"&&uni.getLocalIPAddress({success:o=>{t(o.localip)},fail:()=>{t("")}}),t("")})}function u(){let t="";const r=plus.android.importClass("java.net.NetworkInterface").getByName("wlan0").getHardwareAddress();for(let n=0;n<r.length;n++){let i="";const e=r[n];e<0?i=(255+e+1).toString(16):i=e.toString(16),i.length==1&&(i="0"+i),t+=i}return t}export{u as getDeviceMac,l as getLanIp,f as getMicroAppIp,p as getWifiIp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(r){return r==null}function y(r){return typeof r=="boolean"}function e(r){return typeof r=="number"&&!isNaN(r)}function o(r){return typeof r=="object"&&r!==null}function f(r){return Array.isArray(r)}function s(r){return typeof r=="string"}function u(r){return typeof r!="string"?!1:/^(http|https):\/\/.*?\.(jpg|jpeg|png|gif|svg|webp|avif|bmp)($|\?)/i.test(r)||/^data:image\/.*?;base64,/.test(r)}function c(r){return r===null}function b(r){return r===void 0}function g(r){return typeof r=="symbol"}function a(r){return typeof r=="function"}function d(r){return c(r)?"null":b(r)?"undefined":e(r)?"number":s(r)?u(r)?"image":"string":f(r)?"array":o(r)?"object":g(r)?"symbol":"string"}function p(r){return c(r)?"null":b(r)?"undefined":s(r)?u(r)?"image":"string":e(r)?"number":y(r)?"boolean":g(r)?"symbol":f(r)?"array":o(r)?"object":"string"}function j(r,t,i=20){if(!r)return r;const n=JSON.stringify(r);if((n==null?void 0:n.length)<=i)return n;if(t==="object"||t==="array"){const m=t==="object"?"}":"]";return`[${t}] ${n.substring(0,i)} ... ${m}`}else return`${t} ${n.substring(0,i)} ...`}exports.getValueType=d;exports.isArray=f;exports.isBoolean=y;exports.isFunction=a;exports.isImage=u;exports.isNil=l;exports.isNull=c;exports.isNumber=e;exports.isObject=o;exports.isString=s;exports.isSymbol=g;exports.isUndefined=b;exports.transformValueToShortString=j;exports.transformValueToView=p;
|
package/dist/utils/language.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ export declare function isNumber(value: any): value is number;
|
|
|
6
6
|
export declare function isObject(value: any): value is object;
|
|
7
7
|
export declare function isArray(value: any): value is any[];
|
|
8
8
|
export declare function isString(value: any): value is string;
|
|
9
|
+
export declare function isImage(value: any): boolean;
|
|
9
10
|
export declare function isNull(value: any): value is null;
|
|
10
11
|
export declare function isUndefined(value: any): value is undefined;
|
|
11
12
|
export declare function isSymbol(value: any): value is symbol;
|
|
12
|
-
export declare function isFunction(value: any): value is
|
|
13
|
+
export declare function isFunction(value: any): value is (...args: any[]) => any;
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
15
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/utils/language.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAE3D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAEtD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,GAAG,EAAE,CAElD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAO3C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,IAAI,CAEhD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAE1D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAEvE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,SAAS,CAY1D;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,SAAS,CAalE;AAED,mDAAmD;AACnD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,MAAM,EACZ,SAAS,SAAK,GACb,MAAM,CAWR"}
|
package/dist/utils/language.js
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
|
-
function d(r) {
|
|
2
|
-
return r == null;
|
|
3
|
-
}
|
|
4
|
-
function g(r) {
|
|
5
|
-
return typeof r == "boolean";
|
|
6
|
-
}
|
|
7
|
-
function o(r) {
|
|
8
|
-
return typeof r == "number" && !isNaN(r);
|
|
9
|
-
}
|
|
10
|
-
function e(r) {
|
|
11
|
-
return typeof r == "object" && r !== null;
|
|
12
|
-
}
|
|
13
|
-
function u(r) {
|
|
14
|
-
return Array.isArray(r);
|
|
15
|
-
}
|
|
16
|
-
function f(r) {
|
|
17
|
-
return typeof r == "string";
|
|
18
|
-
}
|
|
19
|
-
function s(r) {
|
|
20
|
-
return r === null;
|
|
21
|
-
}
|
|
22
|
-
function c(r) {
|
|
23
|
-
return r === void 0;
|
|
24
|
-
}
|
|
25
|
-
function b(r) {
|
|
26
|
-
return typeof r == "symbol";
|
|
27
|
-
}
|
|
28
|
-
function m(r) {
|
|
29
|
-
return typeof r == "function";
|
|
30
|
-
}
|
|
31
|
-
function j(r) {
|
|
32
|
-
return s(r) ? "null" : c(r) ? "undefined" : o(r) ? "number" : f(r) ? "string" : u(r) ? "array" : e(r) ? "object" : b(r) ? "symbol" : "string";
|
|
33
|
-
}
|
|
34
|
-
function l(r) {
|
|
35
|
-
return s(r) ? "null" : c(r) ? "undefined" : f(r) ? "string" : o(r) ? "number" : g(r) ? "boolean" : b(r) ? "symbol" : u(r) ? "array" : e(r) ? "object" : "string";
|
|
36
|
-
}
|
|
37
|
-
function N(r, t, i = 20) {
|
|
38
|
-
if (!r)
|
|
39
|
-
return r;
|
|
40
|
-
const n = JSON.stringify(r);
|
|
41
|
-
if ((n == null ? void 0 : n.length) <= i)
|
|
42
|
-
return n;
|
|
43
|
-
if (t === "object" || t === "array") {
|
|
44
|
-
const y = t === "object" ? "}" : "]";
|
|
45
|
-
return `[${t}] ${n.substring(0, i)} ... ${y}`;
|
|
46
|
-
} else
|
|
47
|
-
return `${t} ${n.substring(0, i)} ...`;
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
j as getValueType,
|
|
51
|
-
u as isArray,
|
|
52
|
-
g as isBoolean,
|
|
53
|
-
m as isFunction,
|
|
54
|
-
d as isNil,
|
|
55
|
-
s as isNull,
|
|
56
|
-
o as isNumber,
|
|
57
|
-
e as isObject,
|
|
58
|
-
f as isString,
|
|
59
|
-
b as isSymbol,
|
|
60
|
-
c as isUndefined,
|
|
61
|
-
N as transformValueToShortString,
|
|
62
|
-
l as transformValueToView
|
|
63
|
-
};
|
|
1
|
+
function p(r){return r==null}function m(r){return typeof r=="boolean"}function e(r){return typeof r=="number"&&!isNaN(r)}function f(r){return typeof r=="object"&&r!==null}function o(r){return Array.isArray(r)}function u(r){return typeof r=="string"}function s(r){return typeof r!="string"?!1:/^(http|https):\/\/.*?\.(jpg|jpeg|png|gif|svg|webp|avif|bmp)($|\?)/i.test(r)||/^data:image\/.*?;base64,/.test(r)}function c(r){return r===null}function b(r){return r===void 0}function g(r){return typeof r=="symbol"}function d(r){return typeof r=="function"}function j(r){return c(r)?"null":b(r)?"undefined":e(r)?"number":u(r)?s(r)?"image":"string":o(r)?"array":f(r)?"object":g(r)?"symbol":"string"}function N(r){return c(r)?"null":b(r)?"undefined":u(r)?s(r)?"image":"string":e(r)?"number":m(r)?"boolean":g(r)?"symbol":o(r)?"array":f(r)?"object":"string"}function $(r,t,i=20){if(!r)return r;const n=JSON.stringify(r);if((n==null?void 0:n.length)<=i)return n;if(t==="object"||t==="array"){const y=t==="object"?"}":"]";return`[${t}] ${n.substring(0,i)} ... ${y}`}else return`${t} ${n.substring(0,i)} ...`}export{j as getValueType,o as isArray,m as isBoolean,d as isFunction,s as isImage,p as isNil,c as isNull,e as isNumber,f as isObject,u as isString,g as isSymbol,b as isUndefined,$ as transformValueToShortString,N as transformValueToView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./language.cjs");function p(e,i,r){if(e==null||typeof i!="string")return;const n=i.replace(/\[(\d+)\]/g,".$1").split(".").filter(u=>u!=="");if(n.length===0)return;let t=e;const o=n.length-1;for(let u=0;u<o;u++){const c=n[u];if(!t[c]){const s=n[u+1];t[c]=/^\d+$/.test(s)?[]:{}}t=t[c]}t[n[o]]=r}function m(e,i,r){if(e==null||typeof i!="string")return r;const n=i.replace(/\[(\d+)\]/g,".$1").split(".").filter(o=>o!=="");let t=e;for(const o of n){if(t==null)return r;t=t[o]}return t!==void 0?t:r}function l(e){if(e=g(e),e==null)return 0;const i=typeof e;if(i==="boolean")return 4;if(i==="number")return 8;if(i==="string")return e.length*2;if(i==="symbol"||e instanceof Date)return 8;if(e instanceof RegExp)return l(e.source)+l(e.flags);let r=0;if(r+=24,Array.isArray(e)){r+=4;for(const n of e)r+=8,r+=l(n)}else for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r+=n.length*2,r+=8,r+=l(e[n]));return r}function h(e,i={}){const{precision:r=2,useBinary:n=!0,includeUnit:t=!0}=i;if(e===0)return t?"0 Bytes":"0";const o=n?["B","KiB","MiB","GiB","TiB","PiB"]:["B","KB","MB","GB","TB","PB"],u=n?1024:1e3;let c=0;for(;e>=u&&c<o.length-1;)e/=u,c++;const s=e.toFixed(r);return t?`${s} ${o[c]}`:s}function B(e,i={maxDepth:10}){try{const r=g(e,i.maxDepth||10);return JSON.stringify(r)}catch(r){return`[Serialization Error: ${String(r)}]`}}function g(e,i=6){const r=new WeakMap;function n(t,o,u=[]){if(t==null||typeof t=="boolean"||typeof t=="number")return t;if(typeof t=="bigint")return t.toString();if(typeof t=="function")return"f(...args) { ... }";if(typeof t=="string")return t.length>2e3?t.slice(0,2e3)+"...":t;if(typeof t!="object")return t;if(t._isVue||t.__v_skip||t.$&&t.$.vnode)return"[Vue Component]";if(o<=0)return"[MaxDepth]";if(r.has(t))return`[Circular: ${r.get(t).join(".")||"root"}]`;if(r.set(t,[...u]),Array.isArray(t)){if(t.length>50){const s=t.slice(0,50).map((f,a)=>n(f,o-1,[...u,String(a)]));return s.push(`... ${t.length-50} more items`),s}return t.map((s,f)=>n(s,o-1,[...u,String(f)]))}const c={};try{const s=Object.keys(t);for(const f of s){if(f==="compilerOptions"){c[f]="[Vue Compiler Options]";continue}c[f]=n(t[f],o-1,[...u,f])}}catch{return"[Object Error]"}return c}return n(e,i)}function S(e,i){if(!y.isObject(e))return{};const r={};for(const n of i)n in e&&(r[n]=e[n]);return r}function d(e,i){if(!y.isObject(e))return{};const r={...e};for(const n of i)delete r[n];return r}exports.calculateObjectSize=l;exports.formatStorageSize=h;exports.getValueByPath=m;exports.omit=d;exports.parseValue=g;exports.pick=S;exports.serializeCircular=B;exports.setValueByPath=p;
|
package/dist/utils/object.d.ts
CHANGED
|
@@ -27,18 +27,17 @@ export declare function formatStorageSize(bytes: number, options?: FormatStorage
|
|
|
27
27
|
/**
|
|
28
28
|
* 序列化包含循环引用的对象
|
|
29
29
|
* @param {Object} obj - 要序列化的对象
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {Object} [options] - 选项
|
|
31
31
|
* @returns {string} - 序列化后的字符串
|
|
32
32
|
*/
|
|
33
33
|
export declare function serializeCircular(obj: any, options?: {
|
|
34
|
-
maxDepth
|
|
35
|
-
visited: WeakMap<any, true>;
|
|
34
|
+
maxDepth?: number;
|
|
36
35
|
}): string;
|
|
37
36
|
/**
|
|
38
37
|
* 处理value
|
|
39
38
|
* 基础类型数据直接返回value
|
|
40
|
-
* 引用类型数据判断 value 是否存在循环引用的情况,存在则将循环引用的第二次赋值为
|
|
41
|
-
* 最大处理 deep
|
|
39
|
+
* 引用类型数据判断 value 是否存在循环引用的情况,存在则将循环引用的第二次赋值为 [Circular]
|
|
40
|
+
* 最大处理 deep 层数,并安全跳过导致警告的属性(如 compilerOptions)
|
|
42
41
|
*
|
|
43
42
|
* @export
|
|
44
43
|
* @param {*} value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAgChE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,GAAG,OAoBxE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAkEpD;AAED;;;;;GAKG;AACH,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAqBR;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAE3B,GACA,MAAM,CAOR;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,GAAE,MAAU,OA0EtD;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EACnE,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,CAAC,EAAE,GACR,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAcZ;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EACnE,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,CAAC,EAAE,GACR,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAYZ"}
|
package/dist/utils/object.js
CHANGED
|
@@ -1,136 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function h(t, i, e) {
|
|
3
|
-
if (t == null || typeof i != "string")
|
|
4
|
-
return;
|
|
5
|
-
const n = i.replace(/\[(\d+)\]/g, ".$1").split(".").filter((s) => s !== "");
|
|
6
|
-
if (n.length === 0)
|
|
7
|
-
return;
|
|
8
|
-
let r = t;
|
|
9
|
-
const f = n.length - 1;
|
|
10
|
-
for (let s = 0; s < f; s++) {
|
|
11
|
-
const c = n[s];
|
|
12
|
-
if (!r[c]) {
|
|
13
|
-
const u = n[s + 1];
|
|
14
|
-
r[c] = /^\d+$/.test(u) ? [] : {};
|
|
15
|
-
}
|
|
16
|
-
r = r[c];
|
|
17
|
-
}
|
|
18
|
-
r[n[f]] = e;
|
|
19
|
-
}
|
|
20
|
-
function x(t, i, e) {
|
|
21
|
-
if (t == null || typeof i != "string")
|
|
22
|
-
return e;
|
|
23
|
-
const n = i.replace(/\[(\d+)\]/g, ".$1").split(".").filter((f) => f !== "");
|
|
24
|
-
let r = t;
|
|
25
|
-
for (const f of n) {
|
|
26
|
-
if (r == null)
|
|
27
|
-
return e;
|
|
28
|
-
r = r[f];
|
|
29
|
-
}
|
|
30
|
-
return r !== void 0 ? r : e;
|
|
31
|
-
}
|
|
32
|
-
function o(t) {
|
|
33
|
-
var n;
|
|
34
|
-
if (t = $(t), t == null)
|
|
35
|
-
return 0;
|
|
36
|
-
const i = typeof t;
|
|
37
|
-
if (i === "boolean")
|
|
38
|
-
return 4;
|
|
39
|
-
if (i === "number")
|
|
40
|
-
return 8;
|
|
41
|
-
if (i === "string")
|
|
42
|
-
return t.length * 2;
|
|
43
|
-
if (i === "symbol" || t instanceof Date)
|
|
44
|
-
return 8;
|
|
45
|
-
if (t instanceof RegExp)
|
|
46
|
-
return o(t.source) + o(t.flags);
|
|
47
|
-
let e = 0;
|
|
48
|
-
if (e += 24, Array.isArray(t)) {
|
|
49
|
-
e += 4;
|
|
50
|
-
for (const r of t)
|
|
51
|
-
e += 8, e += o(r);
|
|
52
|
-
} else
|
|
53
|
-
for (const r in t)
|
|
54
|
-
(n = t == null ? void 0 : t.hasOwnProperty) != null && n.call(t, r) && (e += r.length * 2, e += 8, e += o(t[r]));
|
|
55
|
-
return e;
|
|
56
|
-
}
|
|
57
|
-
function k(t, i = {}) {
|
|
58
|
-
const { precision: e = 2, useBinary: n = !0, includeUnit: r = !0 } = i;
|
|
59
|
-
if (t === 0)
|
|
60
|
-
return r ? "0 Bytes" : "0";
|
|
61
|
-
const f = n ? ["B", "KiB", "MiB", "GiB", "TiB", "PiB"] : ["B", "KB", "MB", "GB", "TB", "PB"], s = n ? 1024 : 1e3;
|
|
62
|
-
let c = 0;
|
|
63
|
-
for (; t >= s && c < f.length - 1; )
|
|
64
|
-
t /= s, c++;
|
|
65
|
-
const u = t.toFixed(e);
|
|
66
|
-
return r ? `${u} ${f[c]}` : u;
|
|
67
|
-
}
|
|
68
|
-
function p(t, i = {
|
|
69
|
-
maxDepth: 10,
|
|
70
|
-
visited: /* @__PURE__ */ new WeakMap()
|
|
71
|
-
}) {
|
|
72
|
-
const { maxDepth: e, visited: n } = i;
|
|
73
|
-
return t === null || typeof t != "object" ? JSON.stringify(t) : n.has(t) ? "[Circular]" : (n.set(t, !0), t instanceof Date ? `"${t.toISOString()}"` : t instanceof RegExp ? `/^${t.source}$/${t.flags}` : e <= 0 ? typeof t == "object" ? "{}" : "[]" : Array.isArray(t) ? `[${t.map(
|
|
74
|
-
(c) => p(c, { maxDepth: e - 1, visited: n })
|
|
75
|
-
).join(", ")}]` : `{${Object.keys(t).map((s) => {
|
|
76
|
-
const c = p(t[s], {
|
|
77
|
-
maxDepth: e - 1,
|
|
78
|
-
visited: n
|
|
79
|
-
});
|
|
80
|
-
return `"${s}": ${c}`;
|
|
81
|
-
}).join(", ")}}`);
|
|
82
|
-
}
|
|
83
|
-
function $(t, i = 6) {
|
|
84
|
-
const e = /* @__PURE__ */ new WeakMap();
|
|
85
|
-
function n(r, f, s = []) {
|
|
86
|
-
if (g(r))
|
|
87
|
-
return `${r}`;
|
|
88
|
-
if (y(r))
|
|
89
|
-
return `${r}`;
|
|
90
|
-
if (m(r))
|
|
91
|
-
return "f(...) { ... }";
|
|
92
|
-
if (B(r))
|
|
93
|
-
return `${r}`;
|
|
94
|
-
if (!l(r))
|
|
95
|
-
return r;
|
|
96
|
-
if (f <= 0)
|
|
97
|
-
return "[MaxDepth]";
|
|
98
|
-
if (e.has(r))
|
|
99
|
-
return `[Circular: ${e.get(r).join(".")}]`;
|
|
100
|
-
if (e.set(r, [...s]), Array.isArray(r))
|
|
101
|
-
return r.map(
|
|
102
|
-
(u, a) => n(u, f - 1, [...s, String(a)])
|
|
103
|
-
);
|
|
104
|
-
const c = {};
|
|
105
|
-
for (const [u, a] of Object.entries(r))
|
|
106
|
-
c[u] = n(a, f - 1, [...s, u]);
|
|
107
|
-
return c;
|
|
108
|
-
}
|
|
109
|
-
return n(t, i);
|
|
110
|
-
}
|
|
111
|
-
function S(t, i) {
|
|
112
|
-
if (!l(t))
|
|
113
|
-
return {};
|
|
114
|
-
const e = {};
|
|
115
|
-
for (const n of i)
|
|
116
|
-
n in t && (e[n] = t[n]);
|
|
117
|
-
return e;
|
|
118
|
-
}
|
|
119
|
-
function z(t, i) {
|
|
120
|
-
if (!l(t))
|
|
121
|
-
return {};
|
|
122
|
-
const e = { ...t };
|
|
123
|
-
for (const n of i)
|
|
124
|
-
delete e[n];
|
|
125
|
-
return e;
|
|
126
|
-
}
|
|
127
|
-
export {
|
|
128
|
-
o as calculateObjectSize,
|
|
129
|
-
k as formatStorageSize,
|
|
130
|
-
x as getValueByPath,
|
|
131
|
-
z as omit,
|
|
132
|
-
$ as parseValue,
|
|
133
|
-
S as pick,
|
|
134
|
-
p as serializeCircular,
|
|
135
|
-
h as setValueByPath
|
|
136
|
-
};
|
|
1
|
+
import{isObject as p}from"./language.js";function h(e,i,r){if(e==null||typeof i!="string")return;const n=i.replace(/\[(\d+)\]/g,".$1").split(".").filter(s=>s!=="");if(n.length===0)return;let t=e;const o=n.length-1;for(let s=0;s<o;s++){const f=n[s];if(!t[f]){const u=n[s+1];t[f]=/^\d+$/.test(u)?[]:{}}t=t[f]}t[n[o]]=r}function B(e,i,r){if(e==null||typeof i!="string")return r;const n=i.replace(/\[(\d+)\]/g,".$1").split(".").filter(o=>o!=="");let t=e;for(const o of n){if(t==null)return r;t=t[o]}return t!==void 0?t:r}function g(e){if(e=y(e),e==null)return 0;const i=typeof e;if(i==="boolean")return 4;if(i==="number")return 8;if(i==="string")return e.length*2;if(i==="symbol"||e instanceof Date)return 8;if(e instanceof RegExp)return g(e.source)+g(e.flags);let r=0;if(r+=24,Array.isArray(e)){r+=4;for(const n of e)r+=8,r+=g(n)}else for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r+=n.length*2,r+=8,r+=g(e[n]));return r}function a(e,i={}){const{precision:r=2,useBinary:n=!0,includeUnit:t=!0}=i;if(e===0)return t?"0 Bytes":"0";const o=n?["B","KiB","MiB","GiB","TiB","PiB"]:["B","KB","MB","GB","TB","PB"],s=n?1024:1e3;let f=0;for(;e>=s&&f<o.length-1;)e/=s,f++;const u=e.toFixed(r);return t?`${u} ${o[f]}`:u}function d(e,i={maxDepth:10}){try{const r=y(e,i.maxDepth||10);return JSON.stringify(r)}catch(r){return`[Serialization Error: ${String(r)}]`}}function y(e,i=6){const r=new WeakMap;function n(t,o,s=[]){if(t==null||typeof t=="boolean"||typeof t=="number")return t;if(typeof t=="bigint")return t.toString();if(typeof t=="function")return"f(...args) { ... }";if(typeof t=="string")return t.length>2e3?t.slice(0,2e3)+"...":t;if(typeof t!="object")return t;if(t._isVue||t.__v_skip||t.$&&t.$.vnode)return"[Vue Component]";if(o<=0)return"[MaxDepth]";if(r.has(t))return`[Circular: ${r.get(t).join(".")||"root"}]`;if(r.set(t,[...s]),Array.isArray(t)){if(t.length>50){const u=t.slice(0,50).map((c,l)=>n(c,o-1,[...s,String(l)]));return u.push(`... ${t.length-50} more items`),u}return t.map((u,c)=>n(u,o-1,[...s,String(c)]))}const f={};try{const u=Object.keys(t);for(const c of u){if(c==="compilerOptions"){f[c]="[Vue Compiler Options]";continue}f[c]=n(t[c],o-1,[...s,c])}}catch{return"[Object Error]"}return f}return n(e,i)}function S(e,i){if(!p(e))return{};const r={};for(const n of i)n in e&&(r[n]=e[n]);return r}function k(e,i){if(!p(e))return{};const r={...e};for(const n of i)delete r[n];return r}export{g as calculateObjectSize,a as formatStorageSize,B as getValueByPath,k as omit,y as parseValue,S as pick,d as serializeCircular,h as setValueByPath};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(t){if(t)switch(uni.__dev_tool_platform__){case"web":window.open(t);return;case"app":uni.setClipboardData({data:t}),plus.runtime.openURL(t);return;default:uni.showModal({title:"提示",content:`请自行打开链接: ${t}`,confirmText:"复制",success:function(e){e.confirm&&uni.setClipboardData({data:t})}});return}}exports.openOutLink=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openLink.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"openLink.d.ts","sourceRoot":"","sources":["../../src/utils/openLink.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,QA8BvC"}
|