@sybz-components/utils 0.0.6 → 0.0.7

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
@@ -3,7 +3,7 @@
3
3
  require('@vue/reactivity');
4
4
  require('consola');
5
5
  require('es-toolkit');
6
- const format = require('./shared/utils.DrwfWQ1C.cjs');
6
+ const format = require('./shared/utils.Ck0CV9dy.cjs');
7
7
  require('element-plus');
8
8
  require('./is.cjs');
9
9
 
@@ -17,6 +17,7 @@ exports.copy = format.copy;
17
17
  exports.debounce = format.debounce;
18
18
  exports.getStorage = format.getStorage;
19
19
  exports.getType = format.getType;
20
+ exports.getUtilsBuildTime = format.getUtilsBuildTime;
20
21
  exports.getVariable = format.getVariable;
21
22
  exports.isEmpty = format.isEmpty;
22
23
  exports.log = format.log;
package/dist/base.d.cts CHANGED
@@ -542,6 +542,15 @@ declare function confirm(message: ConfirmMessage, options?: ConfirmOptions, appC
542
542
  * getVariable('--vp-c-brand-1')
543
543
  */
544
544
  declare function getVariable(propertyName: string, fallback?: string): string;
545
+ /**
546
+ * 返回当前 @sybz-components/utils 包的构建时间。
547
+ *
548
+ * @returns 构建时间字符串。
549
+ *
550
+ * @example
551
+ * getUtilsBuildTime()
552
+ */
553
+ declare function getUtilsBuildTime(fallback?: string): string;
545
554
  /**
546
555
  * 返回当前 utils 包的构建时间。
547
556
  *
@@ -552,4 +561,4 @@ declare function getVariable(propertyName: string, fallback?: string): string;
552
561
  */
553
562
  declare function test(): string;
554
563
 
555
- export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger };
564
+ export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger };
package/dist/base.d.mts CHANGED
@@ -542,6 +542,15 @@ declare function confirm(message: ConfirmMessage, options?: ConfirmOptions, appC
542
542
  * getVariable('--vp-c-brand-1')
543
543
  */
544
544
  declare function getVariable(propertyName: string, fallback?: string): string;
545
+ /**
546
+ * 返回当前 @sybz-components/utils 包的构建时间。
547
+ *
548
+ * @returns 构建时间字符串。
549
+ *
550
+ * @example
551
+ * getUtilsBuildTime()
552
+ */
553
+ declare function getUtilsBuildTime(fallback?: string): string;
545
554
  /**
546
555
  * 返回当前 utils 包的构建时间。
547
556
  *
@@ -552,4 +561,4 @@ declare function getVariable(propertyName: string, fallback?: string): string;
552
561
  */
553
562
  declare function test(): string;
554
563
 
555
- export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger };
564
+ export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger };
package/dist/base.d.ts CHANGED
@@ -542,6 +542,15 @@ declare function confirm(message: ConfirmMessage, options?: ConfirmOptions, appC
542
542
  * getVariable('--vp-c-brand-1')
543
543
  */
544
544
  declare function getVariable(propertyName: string, fallback?: string): string;
545
+ /**
546
+ * 返回当前 @sybz-components/utils 包的构建时间。
547
+ *
548
+ * @returns 构建时间字符串。
549
+ *
550
+ * @example
551
+ * getUtilsBuildTime()
552
+ */
553
+ declare function getUtilsBuildTime(fallback?: string): string;
545
554
  /**
546
555
  * 返回当前 utils 包的构建时间。
547
556
  *
@@ -552,4 +561,4 @@ declare function getVariable(propertyName: string, fallback?: string): string;
552
561
  */
553
562
  declare function test(): string;
554
563
 
555
- export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger };
564
+ export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger };
package/dist/base.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import '@vue/reactivity';
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 getVariable, i as isEmpty, l as log, m as merge, p as processWidth, r as random, s as setStorage, j as sleep, t as test, k as throttle, n as toLine, o as tryCatch, u as uuid, v as validForm, q as validate, w as validateTrigger } from './shared/utils.SMYVKGgi.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.DJGyatmd.mjs';
5
5
  import 'element-plus';
6
6
  import './is.mjs';
package/dist/format.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.DrwfWQ1C.cjs');
3
+ const format = require('./shared/utils.Ck0CV9dy.cjs');
4
4
  require('./is.cjs');
5
5
  require('@vue/reactivity');
6
6
  require('consola');
package/dist/format.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { x as formatBytes, y as formatBytesConvert, z as formatDurationTime, A as formatImg, B as formatTextToHtml, C as formatThousands, D as formatTime, E as formatToFixed } from './shared/utils.SMYVKGgi.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.DJGyatmd.mjs';
2
2
  import './is.mjs';
3
3
  import '@vue/reactivity';
4
4
  import 'consola';
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.DrwfWQ1C.cjs');
3
+ const format = require('./shared/utils.Ck0CV9dy.cjs');
4
4
  const day = require('./day.cjs');
5
5
  const is = require('./is.cjs');
6
6
  const ws = require('./ws.cjs');
@@ -30,6 +30,7 @@ exports.formatTime = format.formatTime;
30
30
  exports.formatToFixed = format.formatToFixed;
31
31
  exports.getStorage = format.getStorage;
32
32
  exports.getType = format.getType;
33
+ exports.getUtilsBuildTime = format.getUtilsBuildTime;
33
34
  exports.getVariable = format.getVariable;
34
35
  exports.isEmpty = format.isEmpty;
35
36
  exports.log = format.log;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger } from './base.cjs';
1
+ export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger } from './base.cjs';
2
2
  export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateToMinute } from './day.cjs';
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';
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger } from './base.mjs';
1
+ export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger } from './base.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, WSAutoReconnectOptions, WSHeartbeatOptions, WSOptions } from './ws.mjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger } from './base.js';
1
+ export { $toast, clearStorage, clone, confirm, copy, debounce, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, processWidth, random, setStorage, sleep, test, throttle, toLine, tryCatch, uuid, validForm, validate, validateTrigger } from './base.js';
2
2
  export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateToMinute } from './day.js';
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';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { $ as $toast, c as clearStorage, a as clone, b as confirm, d as copy, e as debounce, x as formatBytes, y as formatBytesConvert, z as formatDurationTime, A as formatImg, B as formatTextToHtml, C as formatThousands, D as formatTime, E as formatToFixed, g as getStorage, f as getType, h as getVariable, i as isEmpty, l as log, m as merge, p as processWidth, r as random, s as setStorage, j as sleep, t as test, k as throttle, n as toLine, o as tryCatch, u as uuid, v as validForm, q as validate, w as validateTrigger } from './shared/utils.SMYVKGgi.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.DJGyatmd.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';
@@ -189,7 +189,7 @@ function formatImg(photoName, addPath = "", { basePath = "assets/images" } = {})
189
189
  const addLastSlash = addPath.endsWith("/") || !addPath ? addPath : `${addPath}/`;
190
190
  const addLastBasePathSlash = basePath.endsWith("/") || !basePath ? basePath : `${basePath}/`;
191
191
  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.DrwfWQ1C.cjs', document.baseURI).href))).href;
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
193
  }
194
194
  function formatToFixed(value, options) {
195
195
  if (typeof options === "number") {
@@ -865,11 +865,11 @@ function confirm(message, options = {}, appContext = null) {
865
865
  cancelButtonText: "\u53D6\u6D88",
866
866
  confirmButtonText: "\u786E\u5B9A",
867
867
  dangerouslyUseHTMLString: true,
868
- ...options,
869
868
  appendTo: resolvedAppendTo,
870
869
  appContext: resolvedAppContext,
871
870
  confirmButtonClass: _mergeClassNames(DEFAULT_CONFIRM_BUTTON_CLASS, options?.confirmButtonClass),
872
- cancelButtonClass: _mergeClassNames(DEFAULT_CANCEL_BUTTON_CLASS, options?.cancelButtonClass)
871
+ cancelButtonClass: _mergeClassNames(DEFAULT_CANCEL_BUTTON_CLASS, options?.cancelButtonClass),
872
+ ...options
873
873
  };
874
874
  return elementPlus.ElMessageBox.confirm(resolvedMessage, mergeOptions);
875
875
  }
@@ -919,8 +919,14 @@ function getVariable(propertyName, fallback = "") {
919
919
  const res = getComputedStyle(document.documentElement).getPropertyValue(propertyName).trim();
920
920
  return res || fallback;
921
921
  }
922
+ const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
923
+ function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
924
+ {
925
+ return "2026-06-12 14:54:43";
926
+ }
927
+ }
922
928
  function test() {
923
- return `build time: ${"2026-06-09 10:40:54"}`;
929
+ return `build time: ${getUtilsBuildTime()}`;
924
930
  }
925
931
 
926
932
  exports.$toast = $toast;
@@ -939,6 +945,7 @@ exports.formatTime = formatTime;
939
945
  exports.formatToFixed = formatToFixed;
940
946
  exports.getStorage = getStorage;
941
947
  exports.getType = getType;
948
+ exports.getUtilsBuildTime = getUtilsBuildTime;
942
949
  exports.getVariable = getVariable;
943
950
  exports.isEmpty = isEmpty;
944
951
  exports.log = log;
@@ -862,11 +862,11 @@ function confirm(message, options = {}, appContext = null) {
862
862
  cancelButtonText: "\u53D6\u6D88",
863
863
  confirmButtonText: "\u786E\u5B9A",
864
864
  dangerouslyUseHTMLString: true,
865
- ...options,
866
865
  appendTo: resolvedAppendTo,
867
866
  appContext: resolvedAppContext,
868
867
  confirmButtonClass: _mergeClassNames(DEFAULT_CONFIRM_BUTTON_CLASS, options?.confirmButtonClass),
869
- cancelButtonClass: _mergeClassNames(DEFAULT_CANCEL_BUTTON_CLASS, options?.cancelButtonClass)
868
+ cancelButtonClass: _mergeClassNames(DEFAULT_CANCEL_BUTTON_CLASS, options?.cancelButtonClass),
869
+ ...options
870
870
  };
871
871
  return ElMessageBox.confirm(resolvedMessage, mergeOptions);
872
872
  }
@@ -916,8 +916,14 @@ function getVariable(propertyName, fallback = "") {
916
916
  const res = getComputedStyle(document.documentElement).getPropertyValue(propertyName).trim();
917
917
  return res || fallback;
918
918
  }
919
+ const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
920
+ function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
921
+ {
922
+ return "2026-06-12 14:54:43";
923
+ }
924
+ }
919
925
  function test() {
920
- return `build time: ${"2026-06-09 10:40:54"}`;
926
+ return `build time: ${getUtilsBuildTime()}`;
921
927
  }
922
928
 
923
- export { $toast as $, formatImg as A, formatTextToHtml as B, formatThousands as C, formatTime as D, formatToFixed as E, clone as a, confirm as b, clearStorage as c, copy as d, debounce as e, getType as f, getStorage as g, getVariable as h, isEmpty as i, sleep as j, throttle as k, log as l, merge as m, toLine as n, tryCatch as o, processWidth as p, validate as q, random as r, setStorage as s, test as t, uuid as u, validForm as v, validateTrigger as w, formatBytes as x, formatBytesConvert as y, formatDurationTime as z };
929
+ export { $toast as $, formatDurationTime as A, formatImg as B, formatTextToHtml as C, formatThousands as D, formatTime as E, formatToFixed as F, clone as a, confirm as b, clearStorage as c, copy as d, debounce as e, getType as f, getStorage as g, getUtilsBuildTime as h, getVariable as i, isEmpty as j, sleep as k, log as l, merge as m, throttle as n, toLine as o, processWidth as p, tryCatch as q, random as r, setStorage as s, test as t, uuid as u, validForm as v, validate as w, validateTrigger as x, formatBytes as y, formatBytesConvert as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybz-components/utils",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "utils of sybz-components",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -15,6 +15,7 @@
15
15
  "registry": "https://registry.npmjs.org"
16
16
  },
17
17
  "scripts": {
18
+ "build": "npx unbuild",
18
19
  "stub": "npx unbuild --stub",
19
20
  "releaseOld": "npx unbuild && npm version patch && git add . && git commit -m \"chore: release @sybz-components/utils v$(npm pkg get version | sed 's/\"//g')\" && git push origin && npm publish",
20
21
  "release": "node ./scripts/release.mjs"