@sybz-components/utils 0.0.7 → 0.0.9

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/dist/base.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- require('@vue/reactivity');
3
+ require('vue');
4
4
  require('consola');
5
5
  require('es-toolkit');
6
- const format = require('./shared/utils.Ck0CV9dy.cjs');
6
+ const format = require('./shared/utils.DQLx7A8M.cjs');
7
7
  require('element-plus');
8
8
  require('./is.cjs');
9
9
 
package/dist/base.d.cts CHANGED
@@ -1,8 +1,7 @@
1
1
  import * as element_plus from 'element-plus';
2
2
  import { MessageOptions, ElMessageBoxOptions } from 'element-plus';
3
3
  import * as vue from 'vue';
4
- import { VNode, AppContext } from 'vue';
5
- import { Ref } from '@vue/reactivity';
4
+ import { VNode, Ref, AppContext } from 'vue';
6
5
 
7
6
  type Func<Args extends any[] = any[], Return = any> = (...args: Args) => Return;
8
7
  type StorageValue = unknown;
@@ -112,12 +111,11 @@ interface CopyOptions extends ToastOptions {
112
111
  }
113
112
  type WidthInput = string | number | Ref<string | number>;
114
113
  type ConfirmMessage = string | VNode | (() => VNode);
115
- type ConfirmAppendTarget = string | HTMLElement | null;
116
114
  interface ConfirmOptions extends ElMessageBoxOptions {
117
115
  /**
118
- * 追加到的挂载节点。支持 css 选择器、DOM 节点或 `null`。
116
+ * 确认框主题。
119
117
  */
120
- appendTo?: ConfirmAppendTarget;
118
+ theme?: '' | 'chenghua';
121
119
  /**
122
120
  * 手动传入 appContext,处理多应用或嵌套弹窗场景。
123
121
  */
package/dist/base.d.mts CHANGED
@@ -1,8 +1,7 @@
1
1
  import * as element_plus from 'element-plus';
2
2
  import { MessageOptions, ElMessageBoxOptions } from 'element-plus';
3
3
  import * as vue from 'vue';
4
- import { VNode, AppContext } from 'vue';
5
- import { Ref } from '@vue/reactivity';
4
+ import { VNode, Ref, AppContext } from 'vue';
6
5
 
7
6
  type Func<Args extends any[] = any[], Return = any> = (...args: Args) => Return;
8
7
  type StorageValue = unknown;
@@ -112,12 +111,11 @@ interface CopyOptions extends ToastOptions {
112
111
  }
113
112
  type WidthInput = string | number | Ref<string | number>;
114
113
  type ConfirmMessage = string | VNode | (() => VNode);
115
- type ConfirmAppendTarget = string | HTMLElement | null;
116
114
  interface ConfirmOptions extends ElMessageBoxOptions {
117
115
  /**
118
- * 追加到的挂载节点。支持 css 选择器、DOM 节点或 `null`。
116
+ * 确认框主题。
119
117
  */
120
- appendTo?: ConfirmAppendTarget;
118
+ theme?: '' | 'chenghua';
121
119
  /**
122
120
  * 手动传入 appContext,处理多应用或嵌套弹窗场景。
123
121
  */
package/dist/base.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import * as element_plus from 'element-plus';
2
2
  import { MessageOptions, ElMessageBoxOptions } from 'element-plus';
3
3
  import * as vue from 'vue';
4
- import { VNode, AppContext } from 'vue';
5
- import { Ref } from '@vue/reactivity';
4
+ import { VNode, Ref, AppContext } from 'vue';
6
5
 
7
6
  type Func<Args extends any[] = any[], Return = any> = (...args: Args) => Return;
8
7
  type StorageValue = unknown;
@@ -112,12 +111,11 @@ interface CopyOptions extends ToastOptions {
112
111
  }
113
112
  type WidthInput = string | number | Ref<string | number>;
114
113
  type ConfirmMessage = string | VNode | (() => VNode);
115
- type ConfirmAppendTarget = string | HTMLElement | null;
116
114
  interface ConfirmOptions extends ElMessageBoxOptions {
117
115
  /**
118
- * 追加到的挂载节点。支持 css 选择器、DOM 节点或 `null`。
116
+ * 确认框主题。
119
117
  */
120
- appendTo?: ConfirmAppendTarget;
118
+ theme?: '' | 'chenghua';
121
119
  /**
122
120
  * 手动传入 appContext,处理多应用或嵌套弹窗场景。
123
121
  */
package/dist/base.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import '@vue/reactivity';
1
+ import 'vue';
2
2
  import 'consola';
3
3
  import 'es-toolkit';
4
- export { $ as $toast, c as clearStorage, a as clone, b as confirm, d as copy, e as debounce, g as getStorage, f as getType, h as getUtilsBuildTime, i as getVariable, j as isEmpty, l as log, m as merge, p as processWidth, r as random, s as setStorage, k as sleep, t as test, n as throttle, o as toLine, q as tryCatch, u as uuid, v as validForm, w as validate, x as validateTrigger } from './shared/utils.DJGyatmd.mjs';
4
+ export { $ as $toast, c as clearStorage, a as clone, b as confirm, d as copy, e as debounce, g as getStorage, f as getType, h as getUtilsBuildTime, i as getVariable, j as isEmpty, l as log, m as merge, p as processWidth, r as random, s as setStorage, k as sleep, t as test, n as throttle, o as toLine, q as tryCatch, u as uuid, v as validForm, w as validate, x as validateTrigger } from './shared/utils.1NRU16hJ.mjs';
5
5
  import 'element-plus';
6
6
  import './is.mjs';
package/dist/format.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.Ck0CV9dy.cjs');
3
+ const format = require('./shared/utils.DQLx7A8M.cjs');
4
4
  require('./is.cjs');
5
- require('@vue/reactivity');
6
5
  require('consola');
6
+ require('vue');
7
7
  require('es-toolkit');
8
8
  require('element-plus');
9
9
 
package/dist/format.mjs CHANGED
@@ -1,6 +1,6 @@
1
- export { y as formatBytes, z as formatBytesConvert, A as formatDurationTime, B as formatImg, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.DJGyatmd.mjs';
1
+ export { y as formatBytes, z as formatBytesConvert, A as formatDurationTime, B as formatImg, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.1NRU16hJ.mjs';
2
2
  import './is.mjs';
3
- import '@vue/reactivity';
4
3
  import 'consola';
4
+ import 'vue';
5
5
  import 'es-toolkit';
6
6
  import 'element-plus';
package/dist/index.cjs CHANGED
@@ -1,11 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.Ck0CV9dy.cjs');
3
+ const format = require('./shared/utils.DQLx7A8M.cjs');
4
4
  const day = require('./day.cjs');
5
5
  const is = require('./is.cjs');
6
6
  const ws = require('./ws.cjs');
7
- const test = require('./test.cjs');
8
- require('@vue/reactivity');
7
+ require('vue');
9
8
  require('consola');
10
9
  require('es-toolkit');
11
10
  require('element-plus');
@@ -75,4 +74,3 @@ exports.objectToString = is.objectToString;
75
74
  exports.toRawType = is.toRawType;
76
75
  exports.toTypeString = is.toTypeString;
77
76
  exports.WS = ws.WS;
78
- exports.onlyTest = test.onlyTest;
package/dist/index.d.cts CHANGED
@@ -3,8 +3,6 @@ export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateT
3
3
  export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.cjs';
4
4
  export { WS, WSAutoReconnectOptions, WSHeartbeatOptions, WSOptions } from './ws.cjs';
5
5
  export { FormatBytesConvertOptions, FormatBytesOptions, FormatImgOptions, FormatTimeFallback, FormatTimeInput, FormatToFixedOptions, formatBytes, formatBytesConvert, formatDurationTime, formatImg, formatTextToHtml, formatThousands, formatTime, formatToFixed } from './format.cjs';
6
- export { onlyTest } from './test.cjs';
7
6
  import 'element-plus';
8
7
  import 'vue';
9
- import '@vue/reactivity';
10
8
  import 'dayjs';
package/dist/index.d.mts CHANGED
@@ -3,8 +3,6 @@ export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateT
3
3
  export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.mjs';
4
4
  export { WS, WSAutoReconnectOptions, WSHeartbeatOptions, WSOptions } from './ws.mjs';
5
5
  export { FormatBytesConvertOptions, FormatBytesOptions, FormatImgOptions, FormatTimeFallback, FormatTimeInput, FormatToFixedOptions, formatBytes, formatBytesConvert, formatDurationTime, formatImg, formatTextToHtml, formatThousands, formatTime, formatToFixed } from './format.mjs';
6
- export { onlyTest } from './test.mjs';
7
6
  import 'element-plus';
8
7
  import 'vue';
9
- import '@vue/reactivity';
10
8
  import 'dayjs';
package/dist/index.d.ts CHANGED
@@ -3,8 +3,6 @@ export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateT
3
3
  export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.js';
4
4
  export { WS, WSAutoReconnectOptions, WSHeartbeatOptions, WSOptions } from './ws.js';
5
5
  export { FormatBytesConvertOptions, FormatBytesOptions, FormatImgOptions, FormatTimeFallback, FormatTimeInput, FormatToFixedOptions, formatBytes, formatBytesConvert, formatDurationTime, formatImg, formatTextToHtml, formatThousands, formatTime, formatToFixed } from './format.js';
6
- export { onlyTest } from './test.js';
7
6
  import 'element-plus';
8
7
  import 'vue';
9
- import '@vue/reactivity';
10
8
  import 'dayjs';
package/dist/index.mjs CHANGED
@@ -1,9 +1,8 @@
1
- export { $ as $toast, c as clearStorage, a as clone, b as confirm, d as copy, e as debounce, y as formatBytes, z as formatBytesConvert, A as formatDurationTime, B as formatImg, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, g as getStorage, f as getType, h as getUtilsBuildTime, i as getVariable, j as isEmpty, l as log, m as merge, p as processWidth, r as random, s as setStorage, k as sleep, t as test, n as throttle, o as toLine, q as tryCatch, u as uuid, v as validForm, w as validate, x as validateTrigger } from './shared/utils.DJGyatmd.mjs';
1
+ export { $ as $toast, c as clearStorage, a as clone, b as confirm, d as copy, e as debounce, y as formatBytes, z as formatBytesConvert, A as formatDurationTime, B as formatImg, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, g as getStorage, f as getType, h as getUtilsBuildTime, i as getVariable, j as isEmpty, l as log, m as merge, p as processWidth, r as random, s as setStorage, k as sleep, t as test, n as throttle, o as toLine, q as tryCatch, u as uuid, v as validForm, w as validate, x as validateTrigger } from './shared/utils.1NRU16hJ.mjs';
2
2
  export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateToMinute } from './day.mjs';
3
3
  export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.mjs';
4
4
  export { WS } from './ws.mjs';
5
- export { onlyTest } from './test.mjs';
6
- import '@vue/reactivity';
5
+ import 'vue';
7
6
  import 'consola';
8
7
  import 'es-toolkit';
9
8
  import 'element-plus';
@@ -1,4 +1,4 @@
1
- import { isRef, unref, toRaw } from '@vue/reactivity';
1
+ import { isRef, unref, toRaw } from 'vue';
2
2
  import { consola } from 'consola';
3
3
  import { cloneDeep } from 'es-toolkit';
4
4
  import { ElMessage, ElMessageBox } from 'element-plus';
@@ -47,9 +47,10 @@ function formatBytesConvert(oBytes, options = {}) {
47
47
  }
48
48
  const regex = /^\d{1,3}(,\d{3})*(\.\d+)?[a-zA-Z ]*$/;
49
49
  if (typeof oBytes === "string" && regex.test(oBytes)) {
50
- bytes = oBytes.replace(/,/g, "");
51
- if (isStringNumber(bytes) || isNumber(bytes) || getType(bytes) !== "string") {
52
- return parseDigitThounsands(bytes);
50
+ const normalizedBytes = oBytes.replace(/,/g, "");
51
+ bytes = normalizedBytes;
52
+ if (isStringNumber(normalizedBytes) || isNumber(normalizedBytes) || getType(normalizedBytes) !== "string") {
53
+ return parseDigitThounsands(normalizedBytes);
53
54
  }
54
55
  }
55
56
  const bytesRegex = /^(\d+(?:\.\d+)?)\s*([BKMGTPEZY]?B|Byte)$/i;
@@ -70,13 +71,13 @@ function formatBytesConvert(oBytes, options = {}) {
70
71
  }
71
72
  const match = bytes.match(bytesRegex);
72
73
  if (!match) {
73
- console.warn("Invalid bytes format. Please provide a valid bytes string, like '100GB'.");
74
+ consola.warn("Invalid bytes format. Please provide a valid bytes string, like '100GB'.");
74
75
  return;
75
76
  }
76
77
  const size = parseFloat(match[1]);
77
78
  const unit = match[2].toUpperCase();
78
79
  if (!Object.prototype.hasOwnProperty.call(units, unit)) {
79
- console.warn(
80
+ consola.warn(
80
81
  "Invalid bytes unit. Please provide a valid unit, like 'B', 'BYTE', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', or 'YB'."
81
82
  );
82
83
  return;
@@ -224,20 +225,22 @@ function formatTextToHtml(str) {
224
225
  if (!str || typeof str !== "string") {
225
226
  return str;
226
227
  }
227
- str = str.replace(/\n/g, "<br>");
228
- str = str.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;");
229
- return str;
228
+ const withBreaks = str.replace(/\n/g, "<br>");
229
+ return withBreaks.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;");
230
230
  }
231
231
 
232
232
  const DEFAULT_CONFIRM_BUTTON_CLASS = "s-message-box__confirm-btn";
233
233
  const DEFAULT_CANCEL_BUTTON_CLASS = "s-message-box__cancel-btn";
234
+ const CHENGHUA_CONFIRM_BOX_CLASS = "s-message-box--chenghua";
235
+ const CHENGHUA_CONFIRM_BUTTON_CLASS = "s-message-box__confirm-btn--chenghua";
236
+ const CHENGHUA_CANCEL_BUTTON_CLASS = "s-message-box__cancel-btn--chenghua";
234
237
  function _getBrowserStorage(isSession = false) {
235
238
  if (typeof window === "undefined") {
236
239
  return null;
237
240
  }
238
241
  try {
239
242
  return isSession ? window.sessionStorage : window.localStorage;
240
- } catch (error) {
243
+ } catch {
241
244
  return null;
242
245
  }
243
246
  }
@@ -250,7 +253,7 @@ function _parseStorageValue(value) {
250
253
  if (typeof parsed !== "number") {
251
254
  return parsed;
252
255
  }
253
- } catch (error) {
256
+ } catch {
254
257
  }
255
258
  return value;
256
259
  }
@@ -332,8 +335,8 @@ function clearStorage(str = "") {
332
335
  sessionStorageRef?.clear();
333
336
  localStorageRef?.clear();
334
337
  }
335
- if (!isEmpty(str) && getType(str) !== "object") {
336
- let strArr = Array.isArray(str) ? str : [str];
338
+ if (typeof str === "string" || Array.isArray(str)) {
339
+ const strArr = Array.isArray(str) ? str : [str];
337
340
  for (let i = 0; i < strArr.length; i++) {
338
341
  sessionStorageRef?.removeItem(strArr[i]);
339
342
  localStorageRef?.removeItem(strArr[i]);
@@ -341,16 +344,18 @@ function clearStorage(str = "") {
341
344
  }
342
345
  if (_isObjectWithExclude(str)) {
343
346
  if (!isEmpty(str.exclude) && getType(str) === "object") {
344
- let sessionStorageObj = {};
345
- let localStorageObj = {};
347
+ const sessionStorageObj = {};
348
+ const localStorageObj = {};
346
349
  for (const key in str.exclude) {
347
350
  if (Object.prototype.hasOwnProperty.call(str.exclude, key)) {
348
351
  const name = str.exclude[key];
349
- if (getStorage(name)) {
350
- localStorageObj[name] = getStorage(name);
352
+ const localValue = getStorage(name);
353
+ const sessionValue = getStorage(name, true);
354
+ if (localValue !== null) {
355
+ localStorageObj[name] = localValue;
351
356
  }
352
- if (getStorage(name, true)) {
353
- sessionStorageObj[name] = getStorage(name, true);
357
+ if (sessionValue !== null) {
358
+ sessionStorageObj[name] = sessionValue;
354
359
  }
355
360
  }
356
361
  }
@@ -366,7 +371,7 @@ function clearStorage(str = "") {
366
371
  }
367
372
  }
368
373
  function _isObjectWithExclude(obj) {
369
- return typeof obj === "object" && obj !== null && "exclude" in obj && typeof obj.exclude === "object";
374
+ return typeof obj === "object" && obj !== null && "exclude" in obj && Array.isArray(obj.exclude);
370
375
  }
371
376
  function validForm(ref, { message = "\u8868\u5355\u6821\u9A8C\u9519\u8BEF, \u8BF7\u68C0\u67E5", detail = false, showMessage = true } = {}) {
372
377
  return new Promise((resolve, reject) => {
@@ -426,7 +431,7 @@ function isEmpty(data, strict = true) {
426
431
  return false;
427
432
  }
428
433
  function merge(obj1, obj2) {
429
- let merged = { ...obj1, ...obj2 };
434
+ const merged = { ...obj1, ...obj2 };
430
435
  for (let key in merged) {
431
436
  if (!isEmpty(obj1[key]) && !isEmpty(obj2[key])) {
432
437
  merged[key] = obj2[key];
@@ -439,13 +444,11 @@ function merge(obj1, obj2) {
439
444
  return merged;
440
445
  }
441
446
  function clone(data, times = 1) {
442
- if (isRef(data)) {
443
- data = unref(data);
447
+ const rawData = isRef(data) ? unref(data) : data;
448
+ if (!Array.isArray(rawData)) {
449
+ return cloneDeep(rawData);
444
450
  }
445
- if (getType(data) !== "array") {
446
- return cloneDeep(data);
447
- }
448
- const clonedData = cloneDeep(data);
451
+ const clonedData = cloneDeep(rawData);
449
452
  const result = [];
450
453
  for (let i = 0; i < times; i++) {
451
454
  result.push(...clonedData);
@@ -619,18 +622,18 @@ function validate(type = "required", rules = {}, pureValid = false) {
619
622
  );
620
623
  }
621
624
  if (type === "between" /* BETWEEN */) {
622
- let min = rulesObject.min;
623
- let max = rulesObject.max;
625
+ let minValue = rulesObject.min ?? "";
626
+ let maxValue = rulesObject.max ?? "";
624
627
  const validateBetween = (rule, value, callback) => {
625
628
  let validFlag = /^-?[0-9]+$/.test(value);
626
629
  if (!validFlag) {
627
630
  callback(new Error("\u8BF7\u8F93\u5165\u6570\u5B57"));
628
631
  }
629
- if (value < min && min !== void 0) {
630
- callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5C0F\u4E8E${min}`));
632
+ if (!isEmpty(minValue) && value < minValue) {
633
+ callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5C0F\u4E8E${minValue}`));
631
634
  }
632
- if (value > max && max !== void 0) {
633
- callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5927\u4E8E${max}`));
635
+ if (!isEmpty(maxValue) && value > maxValue && maxValue !== void 0) {
636
+ callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5927\u4E8E${maxValue}`));
634
637
  }
635
638
  callback();
636
639
  };
@@ -693,6 +696,7 @@ function validate(type = "required", rules = {}, pureValid = false) {
693
696
  trigger
694
697
  };
695
698
  }
699
+ return {};
696
700
  }
697
701
  const copy = (text, toastParams = {}) => {
698
702
  const textarea = document.createElement("textarea");
@@ -703,14 +707,14 @@ const copy = (text, toastParams = {}) => {
703
707
  document.execCommand("copy");
704
708
  document.body.removeChild(textarea);
705
709
  if (!toastParams.hideToast) {
706
- const { hideToast, ...toastOptions } = toastParams;
710
+ const { hideToast: _hideToast, ...toastOptions } = toastParams;
707
711
  $toast(text + "\u590D\u5236\u6210\u529F", toastOptions);
708
712
  return true;
709
713
  }
710
714
  return true;
711
715
  };
712
716
  function log(variableStr, variable, otherInfo = "") {
713
- const stack = new Error().stack.split("\n")[2].trim();
717
+ const stack = new Error().stack?.split("\n")[2]?.trim() ?? "";
714
718
  const matchResult = stack.match(/\((.*):(\d+):(\d+)\)/);
715
719
  let fileInfo = "";
716
720
  try {
@@ -718,11 +722,11 @@ function log(variableStr, variable, otherInfo = "") {
718
722
  const lineNumber = matchResult[2];
719
723
  fileInfo = `vscode://file${JSON.parse(otherInfo)}:${lineNumber}`;
720
724
  }
721
- } catch (error) {
725
+ } catch {
722
726
  fileInfo = otherInfo;
723
727
  }
724
728
  if (isRef(variable)) {
725
- let unrefVariable = unref(variable);
729
+ const unrefVariable = unref(variable);
726
730
  _log(toRaw(unrefVariable));
727
731
  } else {
728
732
  _log(variable);
@@ -752,7 +756,7 @@ function random(min = 0, max = 10) {
752
756
  return Math.floor(Math.random() * (max - min + 1)) + min;
753
757
  }
754
758
  function toLine(text, connect = "-") {
755
- let translateText = text.replace(/([A-Z])/g, (match, p1, offset, origin) => {
759
+ let translateText = text.replace(/([A-Z])/g, (match, _letter, offset) => {
756
760
  if (offset === 0) {
757
761
  return `${match.toLocaleLowerCase()}`;
758
762
  } else {
@@ -801,7 +805,7 @@ async function tryCatch(task, sendLoading) {
801
805
  if (isRef(sendLoading)) {
802
806
  sendLoading.value = value;
803
807
  } else if (sendLoading !== void 0 && sendLoading !== null) {
804
- console.warn("Cannot modify non-ref sendLoading directly!");
808
+ consola.warn("Cannot modify non-ref sendLoading directly!");
805
809
  }
806
810
  };
807
811
  updateLoading(true);
@@ -852,9 +856,19 @@ function debounce(func, delay = 500, immediate, resultCallback) {
852
856
  return _debounce;
853
857
  }
854
858
  function confirm(message, options = {}, appContext = null) {
859
+ const {
860
+ theme,
861
+ customClass,
862
+ confirmButtonClass,
863
+ cancelButtonClass,
864
+ appendTo,
865
+ appContext: optionAppContext,
866
+ ...messageBoxOptions
867
+ } = options;
855
868
  const resolvedMessage = typeof message === "function" ? message() : message;
856
- const resolvedAppendTo = _resolveAppendTarget(options?.appendTo);
857
- const resolvedAppContext = _resolveAppContext(options?.appContext || appContext);
869
+ const resolvedAppendTo = _resolveAppendTarget(appendTo);
870
+ const resolvedAppContext = _resolveAppContext(optionAppContext || appContext);
871
+ const isChenghuaTheme = theme === "chenghua";
858
872
  const mergeOptions = {
859
873
  title: "\u63D0\u793A",
860
874
  draggable: true,
@@ -862,11 +876,20 @@ function confirm(message, options = {}, appContext = null) {
862
876
  cancelButtonText: "\u53D6\u6D88",
863
877
  confirmButtonText: "\u786E\u5B9A",
864
878
  dangerouslyUseHTMLString: true,
879
+ ...messageBoxOptions,
865
880
  appendTo: resolvedAppendTo,
866
881
  appContext: resolvedAppContext,
867
- confirmButtonClass: _mergeClassNames(DEFAULT_CONFIRM_BUTTON_CLASS, options?.confirmButtonClass),
868
- cancelButtonClass: _mergeClassNames(DEFAULT_CANCEL_BUTTON_CLASS, options?.cancelButtonClass),
869
- ...options
882
+ customClass: _mergeClassNames(isChenghuaTheme && CHENGHUA_CONFIRM_BOX_CLASS, customClass),
883
+ confirmButtonClass: _mergeClassNames(
884
+ DEFAULT_CONFIRM_BUTTON_CLASS,
885
+ isChenghuaTheme && CHENGHUA_CONFIRM_BUTTON_CLASS,
886
+ confirmButtonClass
887
+ ),
888
+ cancelButtonClass: _mergeClassNames(
889
+ DEFAULT_CANCEL_BUTTON_CLASS,
890
+ isChenghuaTheme && CHENGHUA_CANCEL_BUTTON_CLASS,
891
+ cancelButtonClass
892
+ )
870
893
  };
871
894
  return ElMessageBox.confirm(resolvedMessage, mergeOptions);
872
895
  }
@@ -885,7 +908,7 @@ function _resolveAppendTarget(appendTo) {
885
908
  try {
886
909
  const selector = rawSelector.startsWith("#") || rawSelector.startsWith(".") || rawSelector.startsWith("[") ? rawSelector : `#${rawSelector}`;
887
910
  return document.querySelector(selector) || appendTo;
888
- } catch (error) {
911
+ } catch {
889
912
  return appendTo;
890
913
  }
891
914
  }
@@ -904,10 +927,14 @@ function _resolveAppContext(appContext) {
904
927
  if (appContext) {
905
928
  return appContext;
906
929
  }
930
+ const installWithContext = ElMessageBox.install;
931
+ const messageBoxWithContext = ElMessageBox;
932
+ const elementPlusContext = installWithContext?.context || messageBoxWithContext._context || null;
907
933
  if (typeof document === "undefined") {
908
- return ElMessageBox.install?.context || ElMessageBox._context;
934
+ return elementPlusContext;
909
935
  }
910
- return ElMessageBox.install?.context || ElMessageBox._context || document.querySelector("#app")?._vue_app?._context;
936
+ const appRoot = document.querySelector("#app");
937
+ return elementPlusContext || appRoot?._vue_app?._context || null;
911
938
  }
912
939
  function getVariable(propertyName, fallback = "") {
913
940
  if (typeof document === "undefined") {
@@ -919,7 +946,7 @@ function getVariable(propertyName, fallback = "") {
919
946
  const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
920
947
  function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
921
948
  {
922
- return "2026-06-12 14:54:43";
949
+ return "2026-06-29 10:10:51";
923
950
  }
924
951
  }
925
952
  function test() {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const reactivity = require('@vue/reactivity');
3
+ const vue = require('vue');
4
4
  const consola = require('consola');
5
5
  const esToolkit = require('es-toolkit');
6
6
  const elementPlus = require('element-plus');
@@ -50,9 +50,10 @@ function formatBytesConvert(oBytes, options = {}) {
50
50
  }
51
51
  const regex = /^\d{1,3}(,\d{3})*(\.\d+)?[a-zA-Z ]*$/;
52
52
  if (typeof oBytes === "string" && regex.test(oBytes)) {
53
- bytes = oBytes.replace(/,/g, "");
54
- if (is.isStringNumber(bytes) || is.isNumber(bytes) || getType(bytes) !== "string") {
55
- return parseDigitThounsands(bytes);
53
+ const normalizedBytes = oBytes.replace(/,/g, "");
54
+ bytes = normalizedBytes;
55
+ if (is.isStringNumber(normalizedBytes) || is.isNumber(normalizedBytes) || getType(normalizedBytes) !== "string") {
56
+ return parseDigitThounsands(normalizedBytes);
56
57
  }
57
58
  }
58
59
  const bytesRegex = /^(\d+(?:\.\d+)?)\s*([BKMGTPEZY]?B|Byte)$/i;
@@ -73,13 +74,13 @@ function formatBytesConvert(oBytes, options = {}) {
73
74
  }
74
75
  const match = bytes.match(bytesRegex);
75
76
  if (!match) {
76
- console.warn("Invalid bytes format. Please provide a valid bytes string, like '100GB'.");
77
+ consola.consola.warn("Invalid bytes format. Please provide a valid bytes string, like '100GB'.");
77
78
  return;
78
79
  }
79
80
  const size = parseFloat(match[1]);
80
81
  const unit = match[2].toUpperCase();
81
82
  if (!Object.prototype.hasOwnProperty.call(units, unit)) {
82
- console.warn(
83
+ consola.consola.warn(
83
84
  "Invalid bytes unit. Please provide a valid unit, like 'B', 'BYTE', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', or 'YB'."
84
85
  );
85
86
  return;
@@ -189,7 +190,7 @@ function formatImg(photoName, addPath = "", { basePath = "assets/images" } = {})
189
190
  const addLastSlash = addPath.endsWith("/") || !addPath ? addPath : `${addPath}/`;
190
191
  const addLastBasePathSlash = basePath.endsWith("/") || !basePath ? basePath : `${basePath}/`;
191
192
  const mergeSrc = `${addLastSlash}${photoName}`;
192
- return new URL(`../${addLastBasePathSlash}${mergeSrc}`, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/utils.Ck0CV9dy.cjs', document.baseURI).href))).href;
193
+ return new URL(`../${addLastBasePathSlash}${mergeSrc}`, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/utils.DQLx7A8M.cjs', document.baseURI).href))).href;
193
194
  }
194
195
  function formatToFixed(value, options) {
195
196
  if (typeof options === "number") {
@@ -227,20 +228,22 @@ function formatTextToHtml(str) {
227
228
  if (!str || typeof str !== "string") {
228
229
  return str;
229
230
  }
230
- str = str.replace(/\n/g, "<br>");
231
- str = str.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;");
232
- return str;
231
+ const withBreaks = str.replace(/\n/g, "<br>");
232
+ return withBreaks.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;");
233
233
  }
234
234
 
235
235
  const DEFAULT_CONFIRM_BUTTON_CLASS = "s-message-box__confirm-btn";
236
236
  const DEFAULT_CANCEL_BUTTON_CLASS = "s-message-box__cancel-btn";
237
+ const CHENGHUA_CONFIRM_BOX_CLASS = "s-message-box--chenghua";
238
+ const CHENGHUA_CONFIRM_BUTTON_CLASS = "s-message-box__confirm-btn--chenghua";
239
+ const CHENGHUA_CANCEL_BUTTON_CLASS = "s-message-box__cancel-btn--chenghua";
237
240
  function _getBrowserStorage(isSession = false) {
238
241
  if (typeof window === "undefined") {
239
242
  return null;
240
243
  }
241
244
  try {
242
245
  return isSession ? window.sessionStorage : window.localStorage;
243
- } catch (error) {
246
+ } catch {
244
247
  return null;
245
248
  }
246
249
  }
@@ -253,7 +256,7 @@ function _parseStorageValue(value) {
253
256
  if (typeof parsed !== "number") {
254
257
  return parsed;
255
258
  }
256
- } catch (error) {
259
+ } catch {
257
260
  }
258
261
  return value;
259
262
  }
@@ -335,8 +338,8 @@ function clearStorage(str = "") {
335
338
  sessionStorageRef?.clear();
336
339
  localStorageRef?.clear();
337
340
  }
338
- if (!isEmpty(str) && getType(str) !== "object") {
339
- let strArr = Array.isArray(str) ? str : [str];
341
+ if (typeof str === "string" || Array.isArray(str)) {
342
+ const strArr = Array.isArray(str) ? str : [str];
340
343
  for (let i = 0; i < strArr.length; i++) {
341
344
  sessionStorageRef?.removeItem(strArr[i]);
342
345
  localStorageRef?.removeItem(strArr[i]);
@@ -344,16 +347,18 @@ function clearStorage(str = "") {
344
347
  }
345
348
  if (_isObjectWithExclude(str)) {
346
349
  if (!isEmpty(str.exclude) && getType(str) === "object") {
347
- let sessionStorageObj = {};
348
- let localStorageObj = {};
350
+ const sessionStorageObj = {};
351
+ const localStorageObj = {};
349
352
  for (const key in str.exclude) {
350
353
  if (Object.prototype.hasOwnProperty.call(str.exclude, key)) {
351
354
  const name = str.exclude[key];
352
- if (getStorage(name)) {
353
- localStorageObj[name] = getStorage(name);
355
+ const localValue = getStorage(name);
356
+ const sessionValue = getStorage(name, true);
357
+ if (localValue !== null) {
358
+ localStorageObj[name] = localValue;
354
359
  }
355
- if (getStorage(name, true)) {
356
- sessionStorageObj[name] = getStorage(name, true);
360
+ if (sessionValue !== null) {
361
+ sessionStorageObj[name] = sessionValue;
357
362
  }
358
363
  }
359
364
  }
@@ -369,11 +374,11 @@ function clearStorage(str = "") {
369
374
  }
370
375
  }
371
376
  function _isObjectWithExclude(obj) {
372
- return typeof obj === "object" && obj !== null && "exclude" in obj && typeof obj.exclude === "object";
377
+ return typeof obj === "object" && obj !== null && "exclude" in obj && Array.isArray(obj.exclude);
373
378
  }
374
379
  function validForm(ref, { message = "\u8868\u5355\u6821\u9A8C\u9519\u8BEF, \u8BF7\u68C0\u67E5", detail = false, showMessage = true } = {}) {
375
380
  return new Promise((resolve, reject) => {
376
- reactivity.unref(ref).validate((valid, status) => {
381
+ vue.unref(ref).validate((valid, status) => {
377
382
  if (valid) {
378
383
  resolve(status);
379
384
  } else {
@@ -398,8 +403,8 @@ function isPlainObject(data) {
398
403
  return proto === Object.prototype || proto === null;
399
404
  }
400
405
  function isEmpty(data, strict = true) {
401
- if (reactivity.isRef(data)) {
402
- data = reactivity.unref(data);
406
+ if (vue.isRef(data)) {
407
+ data = vue.unref(data);
403
408
  }
404
409
  if (data == null) return true;
405
410
  if (data instanceof Date) {
@@ -429,7 +434,7 @@ function isEmpty(data, strict = true) {
429
434
  return false;
430
435
  }
431
436
  function merge(obj1, obj2) {
432
- let merged = { ...obj1, ...obj2 };
437
+ const merged = { ...obj1, ...obj2 };
433
438
  for (let key in merged) {
434
439
  if (!isEmpty(obj1[key]) && !isEmpty(obj2[key])) {
435
440
  merged[key] = obj2[key];
@@ -442,13 +447,11 @@ function merge(obj1, obj2) {
442
447
  return merged;
443
448
  }
444
449
  function clone(data, times = 1) {
445
- if (reactivity.isRef(data)) {
446
- data = reactivity.unref(data);
447
- }
448
- if (getType(data) !== "array") {
449
- return esToolkit.cloneDeep(data);
450
+ const rawData = vue.isRef(data) ? vue.unref(data) : data;
451
+ if (!Array.isArray(rawData)) {
452
+ return esToolkit.cloneDeep(rawData);
450
453
  }
451
- const clonedData = esToolkit.cloneDeep(data);
454
+ const clonedData = esToolkit.cloneDeep(rawData);
452
455
  const result = [];
453
456
  for (let i = 0; i < times; i++) {
454
457
  result.push(...clonedData);
@@ -622,18 +625,18 @@ function validate(type = "required", rules = {}, pureValid = false) {
622
625
  );
623
626
  }
624
627
  if (type === "between" /* BETWEEN */) {
625
- let min = rulesObject.min;
626
- let max = rulesObject.max;
628
+ let minValue = rulesObject.min ?? "";
629
+ let maxValue = rulesObject.max ?? "";
627
630
  const validateBetween = (rule, value, callback) => {
628
631
  let validFlag = /^-?[0-9]+$/.test(value);
629
632
  if (!validFlag) {
630
633
  callback(new Error("\u8BF7\u8F93\u5165\u6570\u5B57"));
631
634
  }
632
- if (value < min && min !== void 0) {
633
- callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5C0F\u4E8E${min}`));
635
+ if (!isEmpty(minValue) && value < minValue) {
636
+ callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5C0F\u4E8E${minValue}`));
634
637
  }
635
- if (value > max && max !== void 0) {
636
- callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5927\u4E8E${max}`));
638
+ if (!isEmpty(maxValue) && value > maxValue && maxValue !== void 0) {
639
+ callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5927\u4E8E${maxValue}`));
637
640
  }
638
641
  callback();
639
642
  };
@@ -696,6 +699,7 @@ function validate(type = "required", rules = {}, pureValid = false) {
696
699
  trigger
697
700
  };
698
701
  }
702
+ return {};
699
703
  }
700
704
  const copy = (text, toastParams = {}) => {
701
705
  const textarea = document.createElement("textarea");
@@ -706,14 +710,14 @@ const copy = (text, toastParams = {}) => {
706
710
  document.execCommand("copy");
707
711
  document.body.removeChild(textarea);
708
712
  if (!toastParams.hideToast) {
709
- const { hideToast, ...toastOptions } = toastParams;
713
+ const { hideToast: _hideToast, ...toastOptions } = toastParams;
710
714
  $toast(text + "\u590D\u5236\u6210\u529F", toastOptions);
711
715
  return true;
712
716
  }
713
717
  return true;
714
718
  };
715
719
  function log(variableStr, variable, otherInfo = "") {
716
- const stack = new Error().stack.split("\n")[2].trim();
720
+ const stack = new Error().stack?.split("\n")[2]?.trim() ?? "";
717
721
  const matchResult = stack.match(/\((.*):(\d+):(\d+)\)/);
718
722
  let fileInfo = "";
719
723
  try {
@@ -721,12 +725,12 @@ function log(variableStr, variable, otherInfo = "") {
721
725
  const lineNumber = matchResult[2];
722
726
  fileInfo = `vscode://file${JSON.parse(otherInfo)}:${lineNumber}`;
723
727
  }
724
- } catch (error) {
728
+ } catch {
725
729
  fileInfo = otherInfo;
726
730
  }
727
- if (reactivity.isRef(variable)) {
728
- let unrefVariable = reactivity.unref(variable);
729
- _log(reactivity.toRaw(unrefVariable));
731
+ if (vue.isRef(variable)) {
732
+ const unrefVariable = vue.unref(variable);
733
+ _log(vue.toRaw(unrefVariable));
730
734
  } else {
731
735
  _log(variable);
732
736
  }
@@ -755,7 +759,7 @@ function random(min = 0, max = 10) {
755
759
  return Math.floor(Math.random() * (max - min + 1)) + min;
756
760
  }
757
761
  function toLine(text, connect = "-") {
758
- let translateText = text.replace(/([A-Z])/g, (match, p1, offset, origin) => {
762
+ let translateText = text.replace(/([A-Z])/g, (match, _letter, offset) => {
759
763
  if (offset === 0) {
760
764
  return `${match.toLocaleLowerCase()}`;
761
765
  } else {
@@ -766,7 +770,7 @@ function toLine(text, connect = "-") {
766
770
  }
767
771
  const _CSS_UNIT_RE = /^[0-9]+(\.[0-9]+)?(px|%|em|rem|vw|vh|ch)$/;
768
772
  function processWidth(initValue, isBase = false) {
769
- const raw = reactivity.unref(initValue);
773
+ const raw = vue.unref(initValue);
770
774
  if (!raw) {
771
775
  return isBase ? "" : {};
772
776
  }
@@ -801,10 +805,10 @@ function throttle(fn, delay = 1e3) {
801
805
  }
802
806
  async function tryCatch(task, sendLoading) {
803
807
  const updateLoading = (value) => {
804
- if (reactivity.isRef(sendLoading)) {
808
+ if (vue.isRef(sendLoading)) {
805
809
  sendLoading.value = value;
806
810
  } else if (sendLoading !== void 0 && sendLoading !== null) {
807
- console.warn("Cannot modify non-ref sendLoading directly!");
811
+ consola.consola.warn("Cannot modify non-ref sendLoading directly!");
808
812
  }
809
813
  };
810
814
  updateLoading(true);
@@ -855,9 +859,19 @@ function debounce(func, delay = 500, immediate, resultCallback) {
855
859
  return _debounce;
856
860
  }
857
861
  function confirm(message, options = {}, appContext = null) {
862
+ const {
863
+ theme,
864
+ customClass,
865
+ confirmButtonClass,
866
+ cancelButtonClass,
867
+ appendTo,
868
+ appContext: optionAppContext,
869
+ ...messageBoxOptions
870
+ } = options;
858
871
  const resolvedMessage = typeof message === "function" ? message() : message;
859
- const resolvedAppendTo = _resolveAppendTarget(options?.appendTo);
860
- const resolvedAppContext = _resolveAppContext(options?.appContext || appContext);
872
+ const resolvedAppendTo = _resolveAppendTarget(appendTo);
873
+ const resolvedAppContext = _resolveAppContext(optionAppContext || appContext);
874
+ const isChenghuaTheme = theme === "chenghua";
861
875
  const mergeOptions = {
862
876
  title: "\u63D0\u793A",
863
877
  draggable: true,
@@ -865,11 +879,20 @@ function confirm(message, options = {}, appContext = null) {
865
879
  cancelButtonText: "\u53D6\u6D88",
866
880
  confirmButtonText: "\u786E\u5B9A",
867
881
  dangerouslyUseHTMLString: true,
882
+ ...messageBoxOptions,
868
883
  appendTo: resolvedAppendTo,
869
884
  appContext: resolvedAppContext,
870
- confirmButtonClass: _mergeClassNames(DEFAULT_CONFIRM_BUTTON_CLASS, options?.confirmButtonClass),
871
- cancelButtonClass: _mergeClassNames(DEFAULT_CANCEL_BUTTON_CLASS, options?.cancelButtonClass),
872
- ...options
885
+ customClass: _mergeClassNames(isChenghuaTheme && CHENGHUA_CONFIRM_BOX_CLASS, customClass),
886
+ confirmButtonClass: _mergeClassNames(
887
+ DEFAULT_CONFIRM_BUTTON_CLASS,
888
+ isChenghuaTheme && CHENGHUA_CONFIRM_BUTTON_CLASS,
889
+ confirmButtonClass
890
+ ),
891
+ cancelButtonClass: _mergeClassNames(
892
+ DEFAULT_CANCEL_BUTTON_CLASS,
893
+ isChenghuaTheme && CHENGHUA_CANCEL_BUTTON_CLASS,
894
+ cancelButtonClass
895
+ )
873
896
  };
874
897
  return elementPlus.ElMessageBox.confirm(resolvedMessage, mergeOptions);
875
898
  }
@@ -888,7 +911,7 @@ function _resolveAppendTarget(appendTo) {
888
911
  try {
889
912
  const selector = rawSelector.startsWith("#") || rawSelector.startsWith(".") || rawSelector.startsWith("[") ? rawSelector : `#${rawSelector}`;
890
913
  return document.querySelector(selector) || appendTo;
891
- } catch (error) {
914
+ } catch {
892
915
  return appendTo;
893
916
  }
894
917
  }
@@ -907,10 +930,14 @@ function _resolveAppContext(appContext) {
907
930
  if (appContext) {
908
931
  return appContext;
909
932
  }
933
+ const installWithContext = elementPlus.ElMessageBox.install;
934
+ const messageBoxWithContext = elementPlus.ElMessageBox;
935
+ const elementPlusContext = installWithContext?.context || messageBoxWithContext._context || null;
910
936
  if (typeof document === "undefined") {
911
- return elementPlus.ElMessageBox.install?.context || elementPlus.ElMessageBox._context;
937
+ return elementPlusContext;
912
938
  }
913
- return elementPlus.ElMessageBox.install?.context || elementPlus.ElMessageBox._context || document.querySelector("#app")?._vue_app?._context;
939
+ const appRoot = document.querySelector("#app");
940
+ return elementPlusContext || appRoot?._vue_app?._context || null;
914
941
  }
915
942
  function getVariable(propertyName, fallback = "") {
916
943
  if (typeof document === "undefined") {
@@ -922,7 +949,7 @@ function getVariable(propertyName, fallback = "") {
922
949
  const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
923
950
  function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
924
951
  {
925
- return "2026-06-12 14:54:43";
952
+ return "2026-06-29 10:10:51";
926
953
  }
927
954
  }
928
955
  function test() {
package/dist/ws.cjs CHANGED
@@ -134,7 +134,7 @@ class WS {
134
134
  try {
135
135
  const res = JSON.parse(data.data);
136
136
  callback(res);
137
- } catch (err) {
137
+ } catch {
138
138
  callback(data);
139
139
  }
140
140
  };
package/dist/ws.mjs CHANGED
@@ -128,7 +128,7 @@ class WS {
128
128
  try {
129
129
  const res = JSON.parse(data.data);
130
130
  callback(res);
131
- } catch (err) {
131
+ } catch {
132
132
  callback(data);
133
133
  }
134
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybz-components/utils",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "utils of sybz-components",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/dist/test.cjs DELETED
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- function onlyTest() {
4
- return "test";
5
- }
6
-
7
- exports.onlyTest = onlyTest;
package/dist/test.d.cts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * 返回当前测试占位字符串。
3
- *
4
- * 这个方法主要用于确认工具函数导出链路是否正常。
5
- *
6
- * @returns 固定字符串 `test`。
7
- *
8
- * @example
9
- * onlyTest()
10
- * // => 'test'
11
- */
12
- declare function onlyTest(): string;
13
-
14
- export { onlyTest };
package/dist/test.d.mts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * 返回当前测试占位字符串。
3
- *
4
- * 这个方法主要用于确认工具函数导出链路是否正常。
5
- *
6
- * @returns 固定字符串 `test`。
7
- *
8
- * @example
9
- * onlyTest()
10
- * // => 'test'
11
- */
12
- declare function onlyTest(): string;
13
-
14
- export { onlyTest };
package/dist/test.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * 返回当前测试占位字符串。
3
- *
4
- * 这个方法主要用于确认工具函数导出链路是否正常。
5
- *
6
- * @returns 固定字符串 `test`。
7
- *
8
- * @example
9
- * onlyTest()
10
- * // => 'test'
11
- */
12
- declare function onlyTest(): string;
13
-
14
- export { onlyTest };
package/dist/test.mjs DELETED
@@ -1,5 +0,0 @@
1
- function onlyTest() {
2
- return "test";
3
- }
4
-
5
- export { onlyTest };