@mingto/tools 1.0.685 → 1.0.687

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 CHANGED
@@ -1,110 +1,225 @@
1
- # @mingto/tools
2
-
3
- 一套实用的 TypeScript 工具库,提供类型安全的函数来简化日常开发任务。
4
-
5
- ## 特性
6
-
7
- - 🎯 **类型安全**:完整的 TypeScript 类型定义支持
8
- - 🔧 **功能丰富**:涵盖字符串、数组、对象、数学运算、浏览器检测、文件处理等多个领域
9
- - 📦 **轻量高效**:按需导入,无冗余代码
10
- - 🌍 **国际化支持**:内置多语言切换功能
11
-
12
- ## 安装
13
-
14
- ```bash
15
- pnpm add @mingto/tools
16
- ```
17
-
18
- ## 功能概览
19
-
20
- ### 类型判断
21
-
22
- ```typescript
23
- import { isNumber, isString, isObject, isArray } from '@mingto/tools'
24
-
25
- isNumber(123) // true
26
- isString('hello') // true
27
- isObject({ a: 1 }) // true
28
- isArray([1, 2, 3]) // true
29
- ```
30
-
31
- ### 空值检查
32
-
33
- ```typescript
34
- import { checkEmpty, checkObjectEmpty, checkArrayEmpty } from '@mingto/tools'
35
-
36
- checkEmpty('') // true
37
- checkEmpty(null) // true
38
- checkEmpty({}) // true
39
- checkEmpty([]) // true
40
- checkEmpty('text') // false
41
- ```
42
-
43
- ### 数学运算
44
-
45
- ```typescript
46
- import { add, subtract, multiply, divide } from '@mingto/tools'
47
-
48
- add(0.1, 0.2) // 0.3 (精确计算,无浮点误差)
49
- subtract(0.3, 0.1) // 0.2
50
- multiply(0.1, 0.2) // 0.02
51
- divide(10, 3) // 3.333...
52
- ```
53
-
54
- ### 字符串处理
55
-
56
- ```typescript
57
- import { chunkString, objectToQueryString, queryStringToObject } from '@mingto/tools'
58
-
59
- chunkString('abcdef', 2) // ['ab', 'cd', 'ef']
60
- objectToQueryString({ a: 1, b: 'x y' }) // 'a=1&b=x%20y'
61
- queryStringToObject('a=1&b=x%20y') // { a: '1', b: 'x y' }
62
- ```
63
-
64
- ### 函数工具
65
-
66
- ```typescript
67
- import { throttle, debounce } from '@mingto/tools'
68
-
69
- const throttledFn = throttle(handleScroll, 500)
70
- const debouncedFn = debounce(handleResize, 300)
71
- ```
72
-
73
- ### 浏览器检测
74
-
75
- ```typescript
76
- import { isMobile, isPc, isIos, isAndroid } from '@mingto/tools'
77
-
78
- isMobile() // true / false
79
- isPc() // true / false
80
- isIos() // true / false
81
- isAndroid() // true / false
82
- ```
83
-
84
- ### 文件处理
85
-
86
- ```typescript
87
- import { getFileSuffix, getFileName, getFileTitle } from '@mingto/tools'
88
-
89
- getFileSuffix('/path/to/file.pdf') // 'pdf'
90
- getFileName('/path/to/file.pdf') // 'file.pdf'
91
- getFileTitle('/path/to/file.pdf') // 'file'
92
- ```
93
-
94
- ### 国际化
95
-
96
- ```typescript
97
- import tools from '@mingto/tools'
98
-
99
- tools.locale('zh-cn') // 设置中文简体
100
- tools.locale('en') // 设置英文
101
- tools.getLocale() // 获取当前语言
102
- ```
103
-
104
- ## 完整 API 文档
105
-
106
- 更多函数和详细用法请参考 [官方文档](https://mingto.github.io/mt-utils/tools/)
107
-
108
- ## 许可证
109
-
110
- MIT
1
+ # @mingto/tools
2
+
3
+ 明途公共 TypeScript 工具库,提供类型判断、浏览器工具、文件处理、数学计算、字符串处理、函数控制、下载、WebSocket、Worker、主题和国际化等能力。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pnpm add @mingto/tools
9
+ ```
10
+
11
+ ## 使用方式
12
+
13
+ ```typescript
14
+ import { isString, add, getFileSuffix } from '@mingto/tools'
15
+
16
+ isString('hello')
17
+ add(0.1, 0.2)
18
+ getFileSuffix('/demo/file.pdf')
19
+ ```
20
+
21
+ 默认导出提供国际化语言设置能力:
22
+
23
+ ```typescript
24
+ import tools from '@mingto/tools'
25
+
26
+ tools.locale('zh-cn')
27
+ tools.getLocale()
28
+ ```
29
+
30
+ ## 模块清单
31
+
32
+ ### array
33
+
34
+ | API | 说明 |
35
+ |-----|------|
36
+ | `chunkArray` | 将数组按指定长度切分 |
37
+
38
+ ### browser
39
+
40
+ | API | 说明 |
41
+ |-----|------|
42
+ | `copyText` | 复制文本到剪贴板 |
43
+ | `createAudioPermission` | 创建音频播放权限辅助能力 |
44
+ | `getAbsoluteUrl` | 获取绝对 URL |
45
+ | `getBrowserFingerprint` | 获取浏览器指纹 |
46
+ | `isAndroid` | 判断 Android 环境 |
47
+ | `isIos` | 判断 iOS 环境 |
48
+ | `isMobile` | 判断移动端环境 |
49
+ | `isPc` | 判断 PC 环境 |
50
+
51
+ ### core
52
+
53
+ | API | 说明 |
54
+ |-----|------|
55
+ | `beParsedAsNumber` | 将值按数字解析 |
56
+ | `canBeParsedAsNumber` | 判断值是否可解析为数字 |
57
+ | `checkArrayEmpty` | 判断数组是否为空 |
58
+ | `checkEmpty` | 判断值是否为空 |
59
+ | `checkEmptyNotZero` | 判断值是否为空但保留数字 0 |
60
+ | `checkObjectEmpty` | 判断对象是否为空 |
61
+ | `isArray` | 判断数组 |
62
+ | `isBoolean` | 判断布尔值 |
63
+ | `isFunction` | 判断函数 |
64
+ | `isNullOrUndefined` | 判断 `null` 或 `undefined` |
65
+ | `isNumber` | 判断数字 |
66
+ | `isObject` | 判断对象 |
67
+ | `isString` | 判断字符串 |
68
+ | `isUndefined` | 判断 `undefined` |
69
+
70
+ ### file
71
+
72
+ | API | 说明 |
73
+ |-----|------|
74
+ | `batchDownloadFile` | 批量下载文件 |
75
+ | `getFileIcon` | 获取文件图标 |
76
+ | `getFileName` | 获取文件名 |
77
+ | `getFilePathNotQuery` | 获取去除 query 的文件路径 |
78
+ | `getFilePathQuery` | 获取文件路径 query |
79
+ | `getFileSuffix` | 获取文件后缀 |
80
+ | `getFileSuffixIcon` | 获取文件后缀图标 |
81
+ | `getFileTitle` | 获取文件标题 |
82
+ | `isCompressFilePath` | 判断压缩文件路径 |
83
+ | `isDocumentFilePath` | 判断文档文件路径 |
84
+ | `isFilePath` | 判断是否为文件路径 |
85
+ | `isImageFilePath` | 判断图片文件路径 |
86
+ | `isMarkdownFilePath` | 判断 Markdown 文件路径 |
87
+ | `isMusicFilePath` | 判断音频文件路径 |
88
+ | `isPptFilePath` | 判断 PPT 文件路径 |
89
+ | `isVideoFilePath` | 判断视频文件路径 |
90
+ | `singleDownloadFile` | 下载单个文件 |
91
+ | `singleDownloadFileBase64` | 下载 Base64 文件 |
92
+ | `updateFilePathQuery` | 更新文件路径 query |
93
+
94
+ 同时导出文件类型枚举与类型:
95
+
96
+ ```typescript
97
+ import type { FileSuffix, ImageFileSuffix } from '@mingto/tools'
98
+ import { FileSuffixEnum, ImageFileSuffixEnum } from '@mingto/tools'
99
+ ```
100
+
101
+ ### function
102
+
103
+ | API | 说明 |
104
+ |-----|------|
105
+ | `debounce` | 防抖函数 |
106
+ | `throttle` | 节流函数 |
107
+
108
+ ### math
109
+
110
+ | API | 说明 |
111
+ |-----|------|
112
+ | `add` | 精确加法 |
113
+ | `subtract` | 精确减法 |
114
+ | `multiply` | 精确乘法 |
115
+ | `divide` | 除法 |
116
+ | `getDecimalPlaces` | 获取小数位数 |
117
+ | `calcAspectRatio` | 计算宽高比 |
118
+
119
+ ### object
120
+
121
+ | API | 说明 |
122
+ |-----|------|
123
+ | `deepFreeze` | 深冻结对象 |
124
+ | `pickObject` | 从对象中选取指定字段 |
125
+
126
+ ### string
127
+
128
+ | API | 说明 |
129
+ |-----|------|
130
+ | `chunkString` | 将字符串按指定长度切分 |
131
+ | `objectToQueryString` | 对象转 query string |
132
+ | `queryStringToObject` | query string 转对象 |
133
+
134
+ ### supply
135
+
136
+ | API | 说明 |
137
+ |-----|------|
138
+ | `getUuid` | 获取 UUID |
139
+ | `timeDelay` | 延迟执行 |
140
+
141
+ ### theme
142
+
143
+ | API | 说明 |
144
+ |-----|------|
145
+ | `useTheme` | 主题相关工具 |
146
+
147
+ ### validator
148
+
149
+ | API | 说明 |
150
+ |-----|------|
151
+ | `isValidBase64` | 校验 Base64 字符串 |
152
+ | `isValidUrl` | 校验 URL |
153
+
154
+ ### web-socket
155
+
156
+ | API | 说明 |
157
+ |-----|------|
158
+ | `createWebSocket` | 创建 WebSocket 连接 |
159
+ | `isWebSocketSupported` | 判断当前环境是否支持 WebSocket |
160
+
161
+ ### wrker
162
+
163
+ | API | 说明 |
164
+ |-----|------|
165
+ | `createWorker` | 创建 Worker |
166
+ | `closeWorker` | 关闭 Worker |
167
+
168
+ ## 常用示例
169
+
170
+ ### 类型判断
171
+
172
+ ```typescript
173
+ import { isArray, isNumber, isObject, isString } from '@mingto/tools'
174
+
175
+ isArray([1, 2, 3])
176
+ isNumber(1)
177
+ isObject({ a: 1 })
178
+ isString('hello')
179
+ ```
180
+
181
+ ### 精确计算
182
+
183
+ ```typescript
184
+ import { add, divide, multiply, subtract } from '@mingto/tools'
185
+
186
+ add(0.1, 0.2)
187
+ subtract(0.3, 0.1)
188
+ multiply(0.1, 0.2)
189
+ divide(10, 2)
190
+ ```
191
+
192
+ ### 文件路径处理
193
+
194
+ ```typescript
195
+ import { getFileName, getFileSuffix, getFileTitle, isImageFilePath } from '@mingto/tools'
196
+
197
+ getFileName('/path/to/demo.png')
198
+ getFileTitle('/path/to/demo.png')
199
+ getFileSuffix('/path/to/demo.png')
200
+ isImageFilePath('/path/to/demo.png')
201
+ ```
202
+
203
+ ### 函数控制
204
+
205
+ ```typescript
206
+ import { debounce, throttle } from '@mingto/tools'
207
+
208
+ const onResize = debounce(() => {}, 300)
209
+ const onScroll = throttle(() => {}, 300)
210
+ ```
211
+
212
+ ### 国际化
213
+
214
+ 支持语言:`zh-cn`、`zh-tw`、`en`、`ms`、`ar`、`th`、`vi`。
215
+
216
+ ```typescript
217
+ import tools from '@mingto/tools'
218
+
219
+ tools.locale('en')
220
+ const locale = tools.getLocale()
221
+ ```
222
+
223
+ ## 许可证
224
+
225
+ ISC
@@ -4,5 +4,5 @@
4
4
  * @param filePath 文件路径。
5
5
  * @returns 查询参数对象。
6
6
  */
7
- declare function getFileQuery(filePath: string): Record<string, any>;
8
- export default getFileQuery;
7
+ declare function getFilePathQuery(filePath: string): Record<string, any>;
8
+ export default getFilePathQuery;
@@ -4,7 +4,7 @@ import { CompressFileSuffixEnum, DocumentFileSuffixEnum, FileSuffixEnum, ImageFi
4
4
  import { default as getFileIcon } from './get-file-icon';
5
5
  import { default as getFileName } from './get-file-name';
6
6
  import { default as getFilePathNotQuery } from './get-file-path-not-query';
7
- import { default as getFileQuery } from './get-file-query';
7
+ import { default as getFilePathQuery } from './get-file-path-query';
8
8
  import { default as getFileSuffix } from './get-file-suffix';
9
9
  import { default as getFileSuffixIcon } from './get-file-suffix-icon';
10
10
  import { default as getFileTitle } from './get-file-title';
@@ -20,4 +20,4 @@ import { default as singleDownloadFile } from './single-download-file';
20
20
  import { default as singleDownloadFileBase64 } from './single-download-file-base64';
21
21
  import { default as updateFilePathQuery } from './update-file-path-query';
22
22
  export type { CompressFileSuffix, DocumentFileSuffix, FileSuffix, ImageFileSuffix, MarkdownFileSuffix, MusicFileSuffix, PptFileSuffix, VideoFileSuffix, };
23
- export { batchDownloadFile, CompressFileSuffixEnum, DocumentFileSuffixEnum, FileSuffixEnum, getFileIcon, getFileName, getFilePathNotQuery, getFileQuery, getFileSuffix, getFileSuffixIcon, getFileTitle, ImageFileSuffixEnum, isCompressFilePath, isDocumentFilePath, isFilePath, isImageFilePath, isMarkdownFilePath, isMusicFilePath, isPptFilePath, isVideoFilePath, MarkdownFileSuffixEnum, MusicFileSuffixEnum, PptFileSuffixEnum, singleDownloadFile, singleDownloadFileBase64, updateFilePathQuery, VideoFileSuffixEnum, };
23
+ export { batchDownloadFile, CompressFileSuffixEnum, DocumentFileSuffixEnum, FileSuffixEnum, getFileIcon, getFileName, getFilePathNotQuery, getFilePathQuery, getFileSuffix, getFileSuffixIcon, getFileTitle, ImageFileSuffixEnum, isCompressFilePath, isDocumentFilePath, isFilePath, isImageFilePath, isMarkdownFilePath, isMusicFilePath, isPptFilePath, isVideoFilePath, MarkdownFileSuffixEnum, MusicFileSuffixEnum, PptFileSuffixEnum, singleDownloadFile, singleDownloadFileBase64, updateFilePathQuery, VideoFileSuffixEnum, };
package/dist/index.js CHANGED
@@ -2,7 +2,14 @@ import axios from "axios";
2
2
  import FileSaver from "file-saver";
3
3
  import JSZip from "jszip";
4
4
  //#region \0rolldown/runtime.js
5
- var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
5
+ var __esmMin = (fn, res, err) => () => {
6
+ if (err) throw err[0];
7
+ try {
8
+ return fn && (res = fn(fn = 0)), res;
9
+ } catch (e) {
10
+ throw err = [e], e;
11
+ }
12
+ };
6
13
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
7
14
  //#endregion
8
15
  //#region \0rollupPluginBabelHelpers.js
@@ -593,7 +600,8 @@ var require_environment_v8_version = /* @__PURE__ */ __commonJSMin(((exports, mo
593
600
  var Deno = globalThis.Deno;
594
601
  var versions = process && process.versions || Deno && Deno.version;
595
602
  var v8 = versions && versions.v8;
596
- var match, version;
603
+ var match;
604
+ var version;
597
605
  if (v8) {
598
606
  match = v8.split(".");
599
607
  version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
@@ -1002,7 +1010,9 @@ var require_internal_state = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1002
1010
  var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
1003
1011
  var TypeError = globalThis.TypeError;
1004
1012
  var WeakMap = globalThis.WeakMap;
1005
- var set, get, has;
1013
+ var set;
1014
+ var get;
1015
+ var has;
1006
1016
  var enforce = function enforce(it) {
1007
1017
  return has(it) ? get(it) : set(it, {});
1008
1018
  };
@@ -3000,7 +3010,9 @@ var require_iterators_core = /* @__PURE__ */ __commonJSMin(((exports, module) =>
3000
3010
  var IS_PURE = require_is_pure();
3001
3011
  var ITERATOR = wellKnownSymbol("iterator");
3002
3012
  var BUGGY_SAFARI_ITERATORS = false;
3003
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
3013
+ var IteratorPrototype;
3014
+ var PrototypeOfArrayIteratorPrototype;
3015
+ var arrayIterator;
3004
3016
  if ([].keys) {
3005
3017
  arrayIterator = [].keys();
3006
3018
  if (!("next" in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
@@ -4212,7 +4224,9 @@ var require_array_buffer_view_core = /* @__PURE__ */ __commonJSMin(((exports, mo
4212
4224
  var TYPED_ARRAY_CONSTRUCTOR = "TypedArrayConstructor";
4213
4225
  var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== "Opera";
4214
4226
  var TYPED_ARRAY_TAG_REQUIRED = false;
4215
- var NAME, Constructor, Prototype;
4227
+ var NAME;
4228
+ var Constructor;
4229
+ var Prototype;
4216
4230
  var TypedArrayConstructorsList = {
4217
4231
  Int8Array: 1,
4218
4232
  Uint8Array: 1,
@@ -6421,7 +6435,10 @@ var require_task = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6421
6435
  var counter = 0;
6422
6436
  var queue = {};
6423
6437
  var ONREADYSTATECHANGE = "onreadystatechange";
6424
- var $location, defer, channel, port;
6438
+ var $location;
6439
+ var defer;
6440
+ var channel;
6441
+ var port;
6425
6442
  fails(function() {
6426
6443
  $location = globalThis.location;
6427
6444
  });
@@ -6555,7 +6572,11 @@ var require_microtask = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6555
6572
  var process = globalThis.process;
6556
6573
  var Promise = globalThis.Promise;
6557
6574
  var microtask = safeGetBuiltIn("queueMicrotask");
6558
- var notify, toggle, node, promise, then;
6575
+ var notify;
6576
+ var toggle;
6577
+ var node;
6578
+ var promise;
6579
+ var then;
6559
6580
  if (!microtask) {
6560
6581
  var queue = new Queue();
6561
6582
  var flush = function flush() {
@@ -6738,7 +6759,10 @@ var require_es_promise_constructor = /* @__PURE__ */ __commonJSMin((() => {
6738
6759
  var REJECTED = 2;
6739
6760
  var HANDLED = 1;
6740
6761
  var UNHANDLED = 2;
6741
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
6762
+ var Internal;
6763
+ var OwnPromiseCapability;
6764
+ var PromiseWrapper;
6765
+ var nativeThen;
6742
6766
  var isThenable = function isThenable(it) {
6743
6767
  var then;
6744
6768
  return isObject(it) && isCallable(then = it.then) ? then : false;
@@ -9288,7 +9312,7 @@ var require_es_typed_array_fill = /* @__PURE__ */ __commonJSMin((() => {
9288
9312
  return call($fill, this, actualValue, length > 1 ? arguments[1] : void 0, length > 2 ? arguments[2] : void 0);
9289
9313
  }, fails(function() {
9290
9314
  var count = 0;
9291
- new Int8Array(2).fill({ valueOf: function valueOf() {
9315
+ (/* @__PURE__ */ new Int8Array(2)).fill({ valueOf: function valueOf() {
9292
9316
  return count++;
9293
9317
  } });
9294
9318
  return count !== 1;
@@ -9525,7 +9549,7 @@ var require_es_typed_array_set = /* @__PURE__ */ __commonJSMin((() => {
9525
9549
  var aTypedArray = ArrayBufferViewCore.aTypedArray;
9526
9550
  var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
9527
9551
  var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function() {
9528
- var array = new Uint8ClampedArray(2);
9552
+ var array = /* @__PURE__ */ new Uint8ClampedArray(2);
9529
9553
  call($set, array, {
9530
9554
  length: 1,
9531
9555
  0: 3
@@ -9568,7 +9592,7 @@ var require_es_typed_array_slice = /* @__PURE__ */ __commonJSMin((() => {
9568
9592
  while (length > index) result[index] = list[index++];
9569
9593
  return result;
9570
9594
  }, fails(function() {
9571
- new Int8Array(1).slice();
9595
+ (/* @__PURE__ */ new Int8Array(1)).slice();
9572
9596
  }));
9573
9597
  }));
9574
9598
  //#endregion
@@ -14918,7 +14942,7 @@ function copyText(text) {
14918
14942
  //#endregion
14919
14943
  //#region src/browser/create-audio-permission.ts
14920
14944
  init__rollupPluginBabelHelpers();
14921
- var AudioPermissionError = /* @__PURE__ */ function(_Error) {
14945
+ var AudioPermissionError = /*#__PURE__*/ function(_Error) {
14922
14946
  function AudioPermissionError(name, message) {
14923
14947
  var _this;
14924
14948
  _classCallCheck(this, AudioPermissionError);
@@ -14936,7 +14960,7 @@ var AudioPermissionError = /* @__PURE__ */ function(_Error) {
14936
14960
  return new AudioPermissionError(name, message || codeMessageMap[name]);
14937
14961
  }
14938
14962
  }]);
14939
- }(/* @__PURE__ */ _wrapNativeSuper(Error));
14963
+ }(/*#__PURE__*/ _wrapNativeSuper(Error));
14940
14964
  /**
14941
14965
  * 音频播放权限管理类
14942
14966
  *
@@ -14980,7 +15004,7 @@ var AudioPermissionError = /* @__PURE__ */ function(_Error) {
14980
15004
  * 如果状态是 “running” 状态则可以播放音频,
14981
15005
  * 如果状态不是 “running” 状态则抛出异常。
14982
15006
  */
14983
- var AudioPlaybackPermission = /* @__PURE__ */ function() {
15007
+ var AudioPlaybackPermission = /*#__PURE__*/ function() {
14984
15008
  function AudioPlaybackPermission() {
14985
15009
  _classCallCheck(this, AudioPlaybackPermission);
14986
15010
  _defineProperty(this, "userInteracted", false);
@@ -15004,7 +15028,7 @@ var AudioPlaybackPermission = /* @__PURE__ */ function() {
15004
15028
  {
15005
15029
  key: "checkInitialAudioContextState",
15006
15030
  value: function() {
15007
- var _checkInitialAudioContextState = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee() {
15031
+ var _checkInitialAudioContextState = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee() {
15008
15032
  var testContext;
15009
15033
  return _regenerator().w(function(_context) {
15010
15034
  while (1) switch (_context.n) {
@@ -15059,7 +15083,7 @@ var AudioPlaybackPermission = /* @__PURE__ */ function() {
15059
15083
  {
15060
15084
  key: "requestPlaybackPermission",
15061
15085
  value: function() {
15062
- var _requestPlaybackPermission = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee2() {
15086
+ var _requestPlaybackPermission = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee2() {
15063
15087
  var audioContext, unknownError, _t;
15064
15088
  return _regenerator().w(function(_context2) {
15065
15089
  while (1) switch (_context2.p = _context2.n) {
@@ -15206,7 +15230,7 @@ var AudioPlaybackPermission = /* @__PURE__ */ function() {
15206
15230
  *
15207
15231
  *
15208
15232
  */
15209
- var MicrophonePermission = /* @__PURE__ */ function() {
15233
+ var MicrophonePermission = /*#__PURE__*/ function() {
15210
15234
  function MicrophonePermission() {
15211
15235
  _classCallCheck(this, MicrophonePermission);
15212
15236
  _defineProperty(this, "microphonePermissionGranted", false);
@@ -15222,7 +15246,7 @@ var MicrophonePermission = /* @__PURE__ */ function() {
15222
15246
  {
15223
15247
  key: "getUserMediaWithTimeout",
15224
15248
  value: function() {
15225
- var _getUserMediaWithTimeout = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee3(constraints) {
15249
+ var _getUserMediaWithTimeout = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee3(constraints) {
15226
15250
  var timeoutMs, _args3 = arguments;
15227
15251
  return _regenerator().w(function(_context3) {
15228
15252
  while (1) switch (_context3.n) {
@@ -15252,7 +15276,7 @@ var MicrophonePermission = /* @__PURE__ */ function() {
15252
15276
  {
15253
15277
  key: "requestMicrophonePermission",
15254
15278
  value: function() {
15255
- var _requestMicrophonePermission = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee4() {
15279
+ var _requestMicrophonePermission = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee4() {
15256
15280
  var result, stream, errorType, audioError, unknownError, _t4, _t5;
15257
15281
  return _regenerator().w(function(_context4) {
15258
15282
  while (1) switch (_context4.p = _context4.n) {
@@ -15378,7 +15402,7 @@ var MicrophonePermission = /* @__PURE__ */ function() {
15378
15402
  /**
15379
15403
  * 统一的音频权限管理类
15380
15404
  */
15381
- var AudioPermission = /* @__PURE__ */ function() {
15405
+ var AudioPermission = /*#__PURE__*/ function() {
15382
15406
  function AudioPermission() {
15383
15407
  _classCallCheck(this, AudioPermission);
15384
15408
  _defineProperty(this, "playbackPermission", void 0);
@@ -15393,7 +15417,7 @@ var AudioPermission = /* @__PURE__ */ function() {
15393
15417
  return _createClass(AudioPermission, [{
15394
15418
  key: "requestPlaybackPermission",
15395
15419
  value: function() {
15396
- var _requestPlaybackPermission2 = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee5() {
15420
+ var _requestPlaybackPermission2 = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee5() {
15397
15421
  return _regenerator().w(function(_context5) {
15398
15422
  while (1) switch (_context5.n) {
15399
15423
  case 0: return _context5.a(2, this.playbackPermission.requestPlaybackPermission());
@@ -15408,7 +15432,7 @@ var AudioPermission = /* @__PURE__ */ function() {
15408
15432
  }, {
15409
15433
  key: "requestMicrophonePermission",
15410
15434
  value: function() {
15411
- var _requestMicrophonePermission2 = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee6() {
15435
+ var _requestMicrophonePermission2 = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee6() {
15412
15436
  return _regenerator().w(function(_context6) {
15413
15437
  while (1) switch (_context6.n) {
15414
15438
  case 0: return _context6.a(2, this.microphonePermission.requestMicrophonePermission());
@@ -15955,21 +15979,17 @@ function chunkString(str) {
15955
15979
  return chunks;
15956
15980
  }
15957
15981
  //#endregion
15958
- //#region src/string/object-to-query-string.ts
15959
- init__rollupPluginBabelHelpers();
15982
+ //#region src/string/get-url-not-query.ts
15960
15983
  /**
15961
- * 将对象转换为 URL 查询字符串。
15962
- * 该函数会遍历对象的键值对,将每个键和值进行 URL 编码,然后以 "key=value" 的形式拼接成字符串,并用 "&" 符号连接。
15963
- *
15964
- * @param obj - 需要转换的对象,对象的键为字符串,值为任意类型。
15965
- * @returns 转换后的 URL 查询字符串。
15984
+ * 获取 URL 中不包含查询参数的主体部分。
15966
15985
  *
15986
+ * @param url URL。
15987
+ * @returns 不包含查询参数的 URL 主体。
15967
15988
  */
15968
- function objectToQueryString(obj) {
15969
- return Object.entries(obj).map(function(_ref) {
15970
- var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
15971
- return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value));
15972
- }).join("&");
15989
+ function getUrlNotQuery(url) {
15990
+ var _matchResult$;
15991
+ var matchResult = url.match(/^([^?]*)/);
15992
+ return (_matchResult$ = matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) !== null && _matchResult$ !== void 0 ? _matchResult$ : url;
15973
15993
  }
15974
15994
  //#endregion
15975
15995
  //#region src/string/query-string-to-object.ts
@@ -15990,6 +16010,54 @@ function queryStringToObject(queryString) {
15990
16010
  }, {});
15991
16011
  }
15992
16012
  //#endregion
16013
+ //#region src/string/get-url-query.ts
16014
+ /**
16015
+ * 获取 URL 中的查询参数。
16016
+ *
16017
+ * @param url URL。
16018
+ * @returns 查询参数对象。
16019
+ */
16020
+ function getUrlQuery(url) {
16021
+ var _matchResult$;
16022
+ var matchResult = url.match(/\?(.*)/);
16023
+ return queryStringToObject((_matchResult$ = matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) !== null && _matchResult$ !== void 0 ? _matchResult$ : "");
16024
+ }
16025
+ //#endregion
16026
+ //#region src/string/object-to-query-string.ts
16027
+ init__rollupPluginBabelHelpers();
16028
+ /**
16029
+ * 将对象转换为 URL 查询字符串。
16030
+ * 该函数会遍历对象的键值对,将每个键和值进行 URL 编码,然后以 "key=value" 的形式拼接成字符串,并用 "&" 符号连接。
16031
+ *
16032
+ * @param obj - 需要转换的对象,对象的键为字符串,值为任意类型。
16033
+ * @returns 转换后的 URL 查询字符串。
16034
+ *
16035
+ */
16036
+ function objectToQueryString(obj) {
16037
+ return Object.entries(obj).map(function(_ref) {
16038
+ var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
16039
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value));
16040
+ }).join("&");
16041
+ }
16042
+ //#endregion
16043
+ //#region src/string/update-url-query.ts
16044
+ init__rollupPluginBabelHelpers();
16045
+ /**
16046
+ * 更新 URL 的查询参数。
16047
+ *
16048
+ * @param url 完整 URL。
16049
+ * @param objectQuery 查询参数对象。
16050
+ * @param isAppend 是否合并原有查询参数,默认 `true` 表示合并;`false` 则仅使用新传入的参数。
16051
+ * @returns 更新后的 URL。
16052
+ */
16053
+ function updateUrlQuery(url, objectQuery) {
16054
+ var isAppend = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
16055
+ var urlPath = getUrlNotQuery(url);
16056
+ var urlQuery = getUrlQuery(url);
16057
+ var queryString = objectToQueryString(isAppend ? _objectSpread2(_objectSpread2({}, urlQuery), objectQuery) : objectQuery);
16058
+ return checkEmpty(queryString) ? urlPath : "".concat(urlPath, "?").concat(queryString);
16059
+ }
16060
+ //#endregion
15993
16061
  //#region src/file/get-file-path-not-query.ts
15994
16062
  /**
15995
16063
  * 获取文件路径(不包含查询参数)。
@@ -16003,14 +16071,14 @@ function getFilePathNotQuery(filePath) {
16003
16071
  return (_matchResult$ = matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) !== null && _matchResult$ !== void 0 ? _matchResult$ : "";
16004
16072
  }
16005
16073
  //#endregion
16006
- //#region src/file/get-file-query.ts
16074
+ //#region src/file/get-file-path-query.ts
16007
16075
  /**
16008
16076
  * 获取 URL 中的查询参数。
16009
16077
  *
16010
16078
  * @param filePath 文件路径。
16011
16079
  * @returns 查询参数对象。
16012
16080
  */
16013
- function getFileQuery(filePath) {
16081
+ function getFilePathQuery(filePath) {
16014
16082
  var _matchResult$;
16015
16083
  var matchResult = filePath.match(filePathRegex);
16016
16084
  return queryStringToObject((_matchResult$ = matchResult === null || matchResult === void 0 ? void 0 : matchResult[6]) !== null && _matchResult$ !== void 0 ? _matchResult$ : "");
@@ -16028,7 +16096,7 @@ function updateFilePathQuery(filePath, objectQuery) {
16028
16096
  var isAppend = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
16029
16097
  var filePathNotQuery = getFilePathNotQuery(filePath);
16030
16098
  var queryString = "";
16031
- if (isAppend) queryString = objectToQueryString(_objectSpread2(_objectSpread2({}, getFileQuery(filePath)), objectQuery));
16099
+ if (isAppend) queryString = objectToQueryString(_objectSpread2(_objectSpread2({}, getFilePathQuery(filePath)), objectQuery));
16032
16100
  else queryString = objectToQueryString(objectQuery);
16033
16101
  return checkEmpty(queryString) ? filePathNotQuery : "".concat(filePathNotQuery, "?").concat(queryString);
16034
16102
  }
@@ -16046,7 +16114,7 @@ function batchDownloadFile(_x, _x2) {
16046
16114
  return _batchDownloadFile.apply(this, arguments);
16047
16115
  }
16048
16116
  function _batchDownloadFile() {
16049
- _batchDownloadFile = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee2(fileList, zipName) {
16117
+ _batchDownloadFile = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee2(fileList, zipName) {
16050
16118
  var zip, zipData, hasZip;
16051
16119
  return _regenerator().w(function(_context2) {
16052
16120
  while (1) switch (_context2.p = _context2.n) {
@@ -16067,8 +16135,8 @@ function _batchDownloadFile() {
16067
16135
  zip = new JSZip();
16068
16136
  _context2.p = 1;
16069
16137
  _context2.n = 2;
16070
- return Promise.all(fileList.map(/* @__PURE__ */ function() {
16071
- var _ref3 = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee(_ref2) {
16138
+ return Promise.all(fileList.map(/*#__PURE__*/ function() {
16139
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee(_ref2) {
16072
16140
  var filePath, fileName, _yield$axios$get, data;
16073
16141
  return _regenerator().w(function(_context) {
16074
16142
  while (1) switch (_context.n) {
@@ -16144,7 +16212,7 @@ var word_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAACwCAMAAA
16144
16212
  /**
16145
16213
  * 文件后缀与图标映射。
16146
16214
  */
16147
- var fileIconMap = new Map([
16215
+ var fileIconMap = /* @__PURE__ */ new Map([
16148
16216
  [FileSuffixEnum.DOC, word_default],
16149
16217
  [FileSuffixEnum.DOCX, word_default],
16150
16218
  [FileSuffixEnum.PPT, ppt_default],
@@ -16307,8 +16375,8 @@ function singleDownloadFile(_x, _x2, _x3) {
16307
16375
  return _singleDownloadFile.apply(this, arguments);
16308
16376
  }
16309
16377
  function _singleDownloadFile() {
16310
- _singleDownloadFile = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee(source, fileName, pathQuery) {
16311
- var base64Url, response, blob, downloadName, requestUrl, _response, link, _t, _t2;
16378
+ _singleDownloadFile = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee(source, fileName, pathQuery) {
16379
+ var base64Url, response, blob, downloadName, isPresigned, requestUrl, _response, link, _t, _t2;
16312
16380
  return _regenerator().w(function(_context) {
16313
16381
  while (1) switch (_context.p = _context.n) {
16314
16382
  case 0:
@@ -16350,7 +16418,10 @@ function _singleDownloadFile() {
16350
16418
  break;
16351
16419
  }
16352
16420
  downloadName = fileName || getFileName(source) || "download";
16353
- requestUrl = updateFilePathQuery(source, pathQuery || { "response-content-type": "application/octet-stream" });
16421
+ isPresigned = /[?&]Signature=/i.test(source);
16422
+ requestUrl = source;
16423
+ if (isPresigned) requestUrl = updateFilePathQuery(source, pathQuery || {});
16424
+ else requestUrl = updateFilePathQuery(source, pathQuery || { "response-content-type": "application/octet-stream" });
16354
16425
  _context.p = 7;
16355
16426
  _context.n = 8;
16356
16427
  return axios.get(requestUrl, { responseType: "blob" });
@@ -16391,7 +16462,7 @@ function downloadBase64File(_x, _x2) {
16391
16462
  return _downloadBase64File.apply(this, arguments);
16392
16463
  }
16393
16464
  function _downloadBase64File() {
16394
- _downloadBase64File = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee(base64Data, fileName) {
16465
+ _downloadBase64File = _asyncToGenerator(/*#__PURE__*/ _regenerator().m(function _callee(base64Data, fileName) {
16395
16466
  var response, blob;
16396
16467
  return _regenerator().w(function(_context) {
16397
16468
  while (1) switch (_context.n) {
@@ -16629,7 +16700,7 @@ function pickObject(obj, keys) {
16629
16700
  * @returns 返回一个随机生成的 UUID 字符串。
16630
16701
  */
16631
16702
  function getUuid() {
16632
- if (typeof window !== "undefined" && window.crypto) return window.crypto.getRandomValues(new Uint32Array(1))[0].toString(36);
16703
+ if (typeof window !== "undefined" && window.crypto) return window.crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0].toString(36);
16633
16704
  return Math.random().toString(36).substring(2);
16634
16705
  }
16635
16706
  //#endregion
@@ -16646,15 +16717,15 @@ function timeDelay(delay) {
16646
16717
  });
16647
16718
  }
16648
16719
  //#endregion
16649
- //#region ../../node_modules/.pnpm/@vue+shared@3.5.34/node_modules/@vue/shared/dist/shared.esm-bundler.js
16720
+ //#region ../../node_modules/.pnpm/@vue+shared@3.5.35/node_modules/@vue/shared/dist/shared.esm-bundler.js
16650
16721
  init__rollupPluginBabelHelpers();
16651
16722
  var _PatchFlagNames;
16652
16723
  /**
16653
- * @vue/shared v3.5.34
16724
+ * @vue/shared v3.5.35
16654
16725
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
16655
16726
  * @license MIT
16656
16727
  **/
16657
- /* @__NO_SIDE_EFFECTS__ */
16728
+ // @__NO_SIDE_EFFECTS__
16658
16729
  function makeMap(str) {
16659
16730
  var map = /* @__PURE__ */ Object.create(null);
16660
16731
  var _iterator = _createForOfIteratorHelper(str.split(",")), _step;
@@ -16788,9 +16859,9 @@ function normalizeClass(value) {
16788
16859
  return res.trim();
16789
16860
  }
16790
16861
  //#endregion
16791
- //#region ../../node_modules/.pnpm/@vue+reactivity@3.5.34/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
16862
+ //#region ../../node_modules/.pnpm/@vue+reactivity@3.5.35/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
16792
16863
  /**
16793
- * @vue/reactivity v3.5.34
16864
+ * @vue/reactivity v3.5.35
16794
16865
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
16795
16866
  * @license MIT
16796
16867
  **/
@@ -16807,7 +16878,7 @@ function getCurrentScope() {
16807
16878
  }
16808
16879
  var activeSub;
16809
16880
  var pausedQueueEffects = /* @__PURE__ */ new WeakSet();
16810
- var ReactiveEffect = /* @__PURE__ */ function() {
16881
+ var ReactiveEffect = /*#__PURE__*/ function() {
16811
16882
  function ReactiveEffect(fn) {
16812
16883
  _classCallCheck(this, ReactiveEffect);
16813
16884
  this.fn = fn;
@@ -17080,14 +17151,14 @@ function cleanupEffect(e) {
17080
17151
  }
17081
17152
  }
17082
17153
  var globalVersion = 0;
17083
- var Link = /* @__PURE__ */ _createClass(function Link(sub, dep) {
17154
+ var Link = /*#__PURE__*/ _createClass(function Link(sub, dep) {
17084
17155
  _classCallCheck(this, Link);
17085
17156
  this.sub = sub;
17086
17157
  this.dep = dep;
17087
17158
  this.version = dep.version;
17088
17159
  this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
17089
17160
  });
17090
- var Dep = /* @__PURE__ */ function() {
17161
+ var Dep = /*#__PURE__*/ function() {
17091
17162
  function Dep(computed) {
17092
17163
  _classCallCheck(this, Dep);
17093
17164
  this.computed = computed;
@@ -17451,7 +17522,7 @@ function hasOwnProperty(key) {
17451
17522
  track(obj, "has", key);
17452
17523
  return obj.hasOwnProperty(key);
17453
17524
  }
17454
- var BaseReactiveHandler = /* @__PURE__ */ function() {
17525
+ var BaseReactiveHandler = /*#__PURE__*/ function() {
17455
17526
  function BaseReactiveHandler() {
17456
17527
  var _isReadonly = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
17457
17528
  var _isShallow = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -17490,7 +17561,7 @@ var BaseReactiveHandler = /* @__PURE__ */ function() {
17490
17561
  }
17491
17562
  }]);
17492
17563
  }();
17493
- var MutableReactiveHandler = /* @__PURE__ */ function(_BaseReactiveHandler) {
17564
+ var MutableReactiveHandler = /*#__PURE__*/ function(_BaseReactiveHandler) {
17494
17565
  function MutableReactiveHandler() {
17495
17566
  var isShallow2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
17496
17567
  _classCallCheck(this, MutableReactiveHandler);
@@ -17553,7 +17624,7 @@ var MutableReactiveHandler = /* @__PURE__ */ function(_BaseReactiveHandler) {
17553
17624
  }
17554
17625
  ]);
17555
17626
  }(BaseReactiveHandler);
17556
- var ReadonlyReactiveHandler = /* @__PURE__ */ function(_BaseReactiveHandler2) {
17627
+ var ReadonlyReactiveHandler = /*#__PURE__*/ function(_BaseReactiveHandler2) {
17557
17628
  function ReadonlyReactiveHandler() {
17558
17629
  var isShallow2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
17559
17630
  _classCallCheck(this, ReadonlyReactiveHandler);
@@ -17754,19 +17825,16 @@ function targetTypeMap(rawType) {
17754
17825
  default: return 0;
17755
17826
  }
17756
17827
  }
17757
- function getTargetType(value) {
17758
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
17759
- }
17760
- /* @__NO_SIDE_EFFECTS__ */
17828
+ // @__NO_SIDE_EFFECTS__
17761
17829
  function reactive(target) {
17762
17830
  if (/* @__PURE__ */ isReadonly(target)) return target;
17763
17831
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
17764
17832
  }
17765
- /* @__NO_SIDE_EFFECTS__ */
17833
+ // @__NO_SIDE_EFFECTS__
17766
17834
  function readonly(target) {
17767
17835
  return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
17768
17836
  }
17769
- /* @__NO_SIDE_EFFECTS__ */
17837
+ // @__NO_SIDE_EFFECTS__
17770
17838
  function shallowReadonly(target) {
17771
17839
  return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
17772
17840
  }
@@ -17776,32 +17844,33 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
17776
17844
  return target;
17777
17845
  }
17778
17846
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) return target;
17779
- var targetType = getTargetType(target);
17780
- if (targetType === 0) return target;
17847
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
17781
17848
  var existingProxy = proxyMap.get(target);
17782
17849
  if (existingProxy) return existingProxy;
17850
+ var targetType = targetTypeMap(toRawType(target));
17851
+ if (targetType === 0) return target;
17783
17852
  var proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
17784
17853
  proxyMap.set(target, proxy);
17785
17854
  return proxy;
17786
17855
  }
17787
- /* @__NO_SIDE_EFFECTS__ */
17856
+ // @__NO_SIDE_EFFECTS__
17788
17857
  function isReactive(value) {
17789
17858
  if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
17790
17859
  return !!(value && value["__v_isReactive"]);
17791
17860
  }
17792
- /* @__NO_SIDE_EFFECTS__ */
17861
+ // @__NO_SIDE_EFFECTS__
17793
17862
  function isReadonly(value) {
17794
17863
  return !!(value && value["__v_isReadonly"]);
17795
17864
  }
17796
- /* @__NO_SIDE_EFFECTS__ */
17865
+ // @__NO_SIDE_EFFECTS__
17797
17866
  function isShallow(value) {
17798
17867
  return !!(value && value["__v_isShallow"]);
17799
17868
  }
17800
- /* @__NO_SIDE_EFFECTS__ */
17869
+ // @__NO_SIDE_EFFECTS__
17801
17870
  function isProxy(value) {
17802
17871
  return value ? !!value["__v_raw"] : false;
17803
17872
  }
17804
- /* @__NO_SIDE_EFFECTS__ */
17873
+ // @__NO_SIDE_EFFECTS__
17805
17874
  function toRaw(observed) {
17806
17875
  var raw = observed && observed["__v_raw"];
17807
17876
  return raw ? /* @__PURE__ */ toRaw(raw) : observed;
@@ -17816,11 +17885,11 @@ var toReactive = function toReactive(value) {
17816
17885
  var toReadonly = function toReadonly(value) {
17817
17886
  return isObject$1(value) ? /* @__PURE__ */ readonly(value) : value;
17818
17887
  };
17819
- /* @__NO_SIDE_EFFECTS__ */
17888
+ // @__NO_SIDE_EFFECTS__
17820
17889
  function isRef(r) {
17821
17890
  return r ? r["__v_isRef"] === true : false;
17822
17891
  }
17823
- /* @__NO_SIDE_EFFECTS__ */
17892
+ // @__NO_SIDE_EFFECTS__
17824
17893
  function ref(value) {
17825
17894
  return createRef(value, false);
17826
17895
  }
@@ -17828,7 +17897,7 @@ function createRef(rawValue, shallow) {
17828
17897
  if (/* @__PURE__ */ isRef(rawValue)) return rawValue;
17829
17898
  return new RefImpl(rawValue, shallow);
17830
17899
  }
17831
- var RefImpl = /* @__PURE__ */ function() {
17900
+ var RefImpl = /*#__PURE__*/ function() {
17832
17901
  function RefImpl(value, isShallow2) {
17833
17902
  _classCallCheck(this, RefImpl);
17834
17903
  this.dep = new Dep();
@@ -17886,7 +17955,7 @@ var shallowUnwrapHandlers = {
17886
17955
  function proxyRefs(objectWithRefs) {
17887
17956
  return /* @__PURE__ */ isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
17888
17957
  }
17889
- var ComputedRefImpl = /* @__PURE__ */ function() {
17958
+ var ComputedRefImpl = /*#__PURE__*/ function() {
17890
17959
  function ComputedRefImpl(fn, setter, isSSR) {
17891
17960
  _classCallCheck(this, ComputedRefImpl);
17892
17961
  this.fn = fn;
@@ -17957,7 +18026,7 @@ var ComputedRefImpl = /* @__PURE__ */ function() {
17957
18026
  }
17958
18027
  }]);
17959
18028
  }();
17960
- /* @__NO_SIDE_EFFECTS__ */
18029
+ // @__NO_SIDE_EFFECTS__
17961
18030
  function computed$1(getterOrOptions, debugOptions) {
17962
18031
  var isSSR = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
17963
18032
  var getter;
@@ -18165,9 +18234,9 @@ function traverse(value) {
18165
18234
  return value;
18166
18235
  }
18167
18236
  //#endregion
18168
- //#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.34/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
18237
+ //#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.35/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
18169
18238
  /**
18170
- * @vue/runtime-core v3.5.34
18239
+ * @vue/runtime-core v3.5.35
18171
18240
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
18172
18241
  * @license MIT
18173
18242
  **/
@@ -19584,9 +19653,9 @@ process.env.NODE_ENV;
19584
19653
  process.env.NODE_ENV;
19585
19654
  process.env.NODE_ENV;
19586
19655
  //#endregion
19587
- //#region ../../node_modules/.pnpm/vue@3.5.34_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
19656
+ //#region ../../node_modules/.pnpm/vue@3.5.35_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
19588
19657
  /**
19589
- * vue v3.5.34
19658
+ * vue v3.5.35
19590
19659
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
19591
19660
  * @license MIT
19592
19661
  **/
@@ -19768,4 +19837,4 @@ var src_default = {
19768
19837
  }
19769
19838
  };
19770
19839
  //#endregion
19771
- export { CompressFileSuffixEnum, DEFAULT_USER_AVATAR, DocumentFileSuffixEnum, FileSuffixEnum, ImageFileSuffixEnum, MarkdownFileSuffixEnum, MusicFileSuffixEnum, PptFileSuffixEnum, VideoFileSuffixEnum, add, batchDownloadFile, beParsedAsNumber, calcAspectRatio, canBeParsedAsNumber, checkArrayEmpty, checkEmpty, checkEmptyNotZero, checkObjectEmpty, chunkArray, chunkString, closeWorker, copyText, createAudioPermission, createWebSocket, createWorker, debounce, deepFreeze, src_default as default, divide, getAbsoluteUrl, getBrowserFingerprint, getDecimalPlaces, getFileIcon, getFileName, getFilePathNotQuery, getFileQuery, getFileSuffix, getFileSuffixIcon, getFileTitle, getUuid, isAndroid, isArray, isBoolean, isCompressFilePath, isDocumentFilePath, isFilePath, isFunction, isImageFilePath, isIos, isMarkdownFilePath, isMobile, isMusicFilePath, isNullOrUndefined, isNumber, isObject, isPc, isPptFilePath, isString, isUndefined, isValidBase64, isValidUrl, isVideoFilePath, isWebSocketSupported, multiply, objectToQueryString, pickObject, queryStringToObject, singleDownloadFile, downloadBase64File as singleDownloadFileBase64, subtract, throttle, timeDelay, updateFilePathQuery, useTheme };
19840
+ export { CompressFileSuffixEnum, DEFAULT_USER_AVATAR, DocumentFileSuffixEnum, FileSuffixEnum, ImageFileSuffixEnum, MarkdownFileSuffixEnum, MusicFileSuffixEnum, PptFileSuffixEnum, VideoFileSuffixEnum, add, batchDownloadFile, beParsedAsNumber, calcAspectRatio, canBeParsedAsNumber, checkArrayEmpty, checkEmpty, checkEmptyNotZero, checkObjectEmpty, chunkArray, chunkString, closeWorker, copyText, createAudioPermission, createWebSocket, createWorker, debounce, deepFreeze, src_default as default, divide, getAbsoluteUrl, getBrowserFingerprint, getDecimalPlaces, getFileIcon, getFileName, getFilePathNotQuery, getFilePathQuery, getFileSuffix, getFileSuffixIcon, getFileTitle, getUrlNotQuery, getUrlQuery, getUuid, isAndroid, isArray, isBoolean, isCompressFilePath, isDocumentFilePath, isFilePath, isFunction, isImageFilePath, isIos, isMarkdownFilePath, isMobile, isMusicFilePath, isNullOrUndefined, isNumber, isObject, isPc, isPptFilePath, isString, isUndefined, isValidBase64, isValidUrl, isVideoFilePath, isWebSocketSupported, multiply, objectToQueryString, pickObject, queryStringToObject, singleDownloadFile, downloadBase64File as singleDownloadFileBase64, subtract, throttle, timeDelay, updateFilePathQuery, updateUrlQuery, useTheme };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 获取 URL 中不包含查询参数的主体部分。
3
+ *
4
+ * @param url URL。
5
+ * @returns 不包含查询参数的 URL 主体。
6
+ */
7
+ declare function getUrlNotQuery(url: string): string;
8
+ export default getUrlNotQuery;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 获取 URL 中的查询参数。
3
+ *
4
+ * @param url URL。
5
+ * @returns 查询参数对象。
6
+ */
7
+ declare function getUrlQuery(url: string): Record<string, any>;
8
+ export default getUrlQuery;
@@ -1,4 +1,7 @@
1
1
  import { default as chunkString } from './chunk-string';
2
+ import { default as getUrlNotQuery } from './get-url-not-query';
3
+ import { default as getUrlQuery } from './get-url-query';
2
4
  import { default as objectToQueryString } from './object-to-query-string';
3
5
  import { default as queryStringToObject } from './query-string-to-object';
4
- export { chunkString, objectToQueryString, queryStringToObject };
6
+ import { default as updateUrlQuery } from './update-url-query';
7
+ export { chunkString, getUrlNotQuery, getUrlQuery, objectToQueryString, queryStringToObject, updateUrlQuery };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 更新 URL 的查询参数。
3
+ *
4
+ * @param url 完整 URL。
5
+ * @param objectQuery 查询参数对象。
6
+ * @param isAppend 是否合并原有查询参数,默认 `true` 表示合并;`false` 则仅使用新传入的参数。
7
+ * @returns 更新后的 URL。
8
+ */
9
+ declare function updateUrlQuery(url: string, objectQuery: Record<string, string>, isAppend?: boolean): string;
10
+ export default updateUrlQuery;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mingto/tools",
3
3
  "type": "module",
4
- "version": "1.0.685",
4
+ "version": "1.0.687",
5
5
  "description": "明途公共工具库",
6
6
  "author": "hcc",
7
7
  "license": "ISC",