@vef-framework/shared 2.0.3 → 2.0.5

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.
Files changed (61) hide show
  1. package/dist/cjs/color/color-ops.cjs +1 -76
  2. package/dist/cjs/color/index.cjs +1 -24
  3. package/dist/cjs/color/name.cjs +1 -49
  4. package/dist/cjs/color/palette.cjs +1 -126
  5. package/dist/cjs/constants/color-names.cjs +1 -1580
  6. package/dist/cjs/constants/color-palettes.cjs +1 -372
  7. package/dist/cjs/constants/index.cjs +1 -14
  8. package/dist/cjs/index.cjs +1 -339
  9. package/dist/cjs/types/color.cjs +1 -3
  10. package/dist/cjs/types/common.cjs +1 -3
  11. package/dist/cjs/types/deep-keys.cjs +1 -3
  12. package/dist/cjs/types/index.cjs +1 -7
  13. package/dist/cjs/utils/chrono.cjs +1 -139
  14. package/dist/cjs/utils/equal.cjs +1 -175
  15. package/dist/cjs/utils/error.cjs +3 -60
  16. package/dist/cjs/utils/event.cjs +1 -62
  17. package/dist/cjs/utils/format.cjs +1 -31
  18. package/dist/cjs/utils/function.cjs +1 -49
  19. package/dist/cjs/utils/id.cjs +1 -38
  20. package/dist/cjs/utils/index.cjs +1 -86
  21. package/dist/cjs/utils/key.cjs +1 -34
  22. package/dist/cjs/utils/lib.cjs +1 -234
  23. package/dist/cjs/utils/object.cjs +1 -20
  24. package/dist/cjs/utils/path.cjs +1 -63
  25. package/dist/cjs/utils/pinyin.cjs +1 -53
  26. package/dist/cjs/utils/security.cjs +1 -44
  27. package/dist/cjs/utils/string.cjs +1 -13
  28. package/dist/cjs/utils/task.cjs +1 -17
  29. package/dist/cjs/utils/tree.cjs +1 -262
  30. package/dist/cjs/utils/zod.cjs +1 -14
  31. package/dist/es/color/color-ops.js +64 -58
  32. package/dist/es/color/index.js +18 -4
  33. package/dist/es/color/name.js +24 -37
  34. package/dist/es/color/palette.js +67 -100
  35. package/dist/es/constants/color-names.js +6 -9
  36. package/dist/es/constants/color-palettes.js +8 -15
  37. package/dist/es/constants/index.js +8 -3
  38. package/dist/es/index.js +165 -30
  39. package/dist/es/types/color.js +1 -1
  40. package/dist/es/types/common.js +1 -1
  41. package/dist/es/types/deep-keys.js +1 -1
  42. package/dist/es/types/index.js +3 -4
  43. package/dist/es/utils/chrono.js +71 -88
  44. package/dist/es/utils/equal.js +111 -161
  45. package/dist/es/utils/error.js +28 -25
  46. package/dist/es/utils/event.js +18 -23
  47. package/dist/es/utils/format.js +16 -22
  48. package/dist/es/utils/function.js +32 -32
  49. package/dist/es/utils/id.js +18 -27
  50. package/dist/es/utils/index.js +80 -18
  51. package/dist/es/utils/key.js +19 -25
  52. package/dist/es/utils/lib.js +64 -10
  53. package/dist/es/utils/object.js +11 -14
  54. package/dist/es/utils/path.js +57 -48
  55. package/dist/es/utils/pinyin.js +28 -29
  56. package/dist/es/utils/security.js +29 -37
  57. package/dist/es/utils/string.js +7 -8
  58. package/dist/es/utils/task.js +7 -12
  59. package/dist/es/utils/tree.js +156 -219
  60. package/dist/es/utils/zod.js +7 -6
  61. package/package.json +1 -1
@@ -1,41 +1,41 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- function isAsyncFunction(fn) {
3
- return fn.constructor.name === "AsyncFunction" || Object.prototype.toString.call(fn) === "[object AsyncFunction]" || fn.toString().startsWith("async ");
1
+ function m(t) {
2
+ return t.constructor.name === "AsyncFunction" || Object.prototype.toString.call(t) === "[object AsyncFunction]" || t.toString().startsWith("async ");
4
3
  }
5
- async function invokeAwaitableFn(fn, args, options) {
4
+ async function y(t, e, c) {
6
5
  const {
7
- onInvoke,
8
- onSuccess,
9
- onError,
10
- onFinally
11
- } = options;
12
- const returned = fn(...args);
13
- if (returned instanceof Promise) {
14
- let context;
6
+ onInvoke: i,
7
+ onSuccess: s,
8
+ onError: l,
9
+ onFinally: u
10
+ } = c, r = t(...e);
11
+ if (r instanceof Promise) {
12
+ let o;
15
13
  try {
16
- context = onInvoke?.();
17
- const result = await returned;
18
- onSuccess?.(result, context);
19
- return result;
20
- } catch (error) {
21
- onError?.(error, context);
22
- throw error;
14
+ o = i?.();
15
+ const n = await r;
16
+ return s?.(n, o), n;
17
+ } catch (n) {
18
+ throw l?.(n, o), n;
23
19
  } finally {
24
- onFinally?.(context);
20
+ u?.(o);
25
21
  }
26
- } else {
27
- return returned;
28
- }
22
+ } else
23
+ return r;
29
24
  }
30
- function identity(value) {
31
- return value;
25
+ function p(t) {
26
+ return t;
32
27
  }
33
- function createThrowNotImplementedFn(feature) {
34
- return () => throwNotImplemented(feature);
28
+ function w(t) {
29
+ return () => a(t);
35
30
  }
36
- function throwNotImplemented(feature) {
37
- const label = feature ? `${feature} not implemented` : "Not implemented";
38
- throw new Error(label);
31
+ function a(t) {
32
+ const e = t ? `${t} not implemented` : "Not implemented";
33
+ throw new Error(e);
39
34
  }
40
-
41
- export { createThrowNotImplementedFn, identity, invokeAwaitableFn, isAsyncFunction, throwNotImplemented };
35
+ export {
36
+ w as createThrowNotImplementedFn,
37
+ p as identity,
38
+ y as invokeAwaitableFn,
39
+ m as isAsyncFunction,
40
+ a as throwNotImplemented
41
+ };
@@ -1,34 +1,25 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import { init } from '@paralleldrive/cuid2';
3
- import { isNullish } from 'radashi';
4
-
5
- function isFingerprintSupported() {
6
- if (isNullish(navigator)) {
7
- return false;
8
- }
9
- if (navigator.userAgent.includes("jsdom")) {
10
- return false;
11
- }
12
- return true;
1
+ import { init as r } from "@paralleldrive/cuid2";
2
+ import { isNullish as n } from "radashi";
3
+ function o() {
4
+ return !(n(navigator) || navigator.userAgent.includes("jsdom"));
13
5
  }
14
- let createId = init({
6
+ let e = r({
15
7
  length: 16,
16
8
  // vef-framework default fingerprint
17
9
  fingerprint: "0cd902ccad1f26c27b8db84af2282b7b"
18
10
  });
19
- if (isFingerprintSupported()) {
20
- import('@fingerprintjs/fingerprintjs').then(({ load }) => load()).then((fp) => fp.get()).then((result) => {
21
- const fingerprint = result.visitorId;
22
- createId = init({
23
- length: 16,
24
- fingerprint
25
- });
26
- }).catch((error) => {
27
- console.error("Failed to initialize fingerprint:", error);
11
+ o() && import("@fingerprintjs/fingerprintjs").then(({ load: t }) => t()).then((t) => t.get()).then((t) => {
12
+ const i = t.visitorId;
13
+ e = r({
14
+ length: 16,
15
+ fingerprint: i
28
16
  });
17
+ }).catch((t) => {
18
+ console.error("Failed to initialize fingerprint:", t);
19
+ });
20
+ function c() {
21
+ return e();
29
22
  }
30
- function generateId() {
31
- return createId();
32
- }
33
-
34
- export { generateId };
23
+ export {
24
+ c as generateId
25
+ };
@@ -1,18 +1,80 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- export { DEFAULT_DATETIME_FORMAT, DEFAULT_DATE_FORMAT, DEFAULT_TIME_FORMAT, LOCALIZED_DATETIME_FORMAT, LOCALIZED_DATE_FORMAT, formatDate, formatDuration, getLocalizedDateTime, getNow, getNowDateString, getNowDateTimeString, getNowTimeString, getTemporalFormats, parseDate, tryParseDate } from './chrono.js';
3
- export { isDeepEqual, isShallowEqual } from './equal.js';
4
- export { filterUserFrame, getCurrentStack, getCurrentStackSync, getSanitizedErrorStack, parseErrorStack } from './error.js';
5
- export { EventEmitter, createEventEmitter } from './event.js';
6
- export { formatBytes, formatNumber } from './format.js';
7
- export { createThrowNotImplementedFn, identity, invokeAwaitableFn, isAsyncFunction, throwNotImplemented } from './function.js';
8
- export { generateId } from './id.js';
9
- export { hashKey } from './key.js';
10
- export { alwaysFalse, alwaysTrue } from './lib.js';
11
- export { mergeWith } from './object.js';
12
- export { formatPath, getBaseName, getDirName, getExtName, getRelativePath, isAbsolutePath, joinPaths, normalizePath, parsePath, pathSeparator, resolvePath } from './path.js';
13
- export { getPinyin, getPinyinInitials, withPinyin } from './pinyin.js';
14
- export { decryptUsingRSA, encryptUsingRSA } from './security.js';
15
- export { constantCase } from './string.js';
16
- export { scheduleMicrotask } from './task.js';
17
- export { buildTree, filterTree, filterTreeWithAncestors, findNodeInTree, flattenTree, mapTree, traverseTree } from './tree.js';
18
- import './zod.js';
1
+ import { DEFAULT_DATETIME_FORMAT as o, DEFAULT_DATE_FORMAT as a, DEFAULT_TIME_FORMAT as i, LOCALIZED_DATETIME_FORMAT as m, LOCALIZED_DATE_FORMAT as n, formatDate as s, formatDuration as p, getLocalizedDateTime as T, getNow as f, getNowDateString as l, getNowDateTimeString as g, getNowTimeString as E, getTemporalFormats as A, parseDate as D, tryParseDate as h } from "./chrono.js";
2
+ import { isDeepEqual as c, isShallowEqual as F } from "./equal.js";
3
+ import { filterUserFrame as S, getCurrentStack as d, getCurrentStackSync as u, getSanitizedErrorStack as w, parseErrorStack as N } from "./error.js";
4
+ import { EventEmitter as I, createEventEmitter as _ } from "./event.js";
5
+ import { formatBytes as L, formatNumber as R } from "./format.js";
6
+ import { createThrowNotImplementedFn as k, identity as v, invokeAwaitableFn as U, isAsyncFunction as C, throwNotImplemented as b } from "./function.js";
7
+ import { generateId as q } from "./id.js";
8
+ import { hashKey as W } from "./key.js";
9
+ import { alwaysFalse as j, alwaysTrue as K } from "./lib.js";
10
+ import { mergeWith as H } from "./object.js";
11
+ import { formatPath as Q, getBaseName as V, getDirName as X, getExtName as Y, getRelativePath as $, isAbsolutePath as ee, joinPaths as te, normalizePath as re, parsePath as oe, pathSeparator as ae, resolvePath as ie } from "./path.js";
12
+ import { getPinyin as ne, getPinyinInitials as se, withPinyin as pe } from "./pinyin.js";
13
+ import { decryptUsingRSA as fe, encryptUsingRSA as le } from "./security.js";
14
+ import { constantCase as Ee } from "./string.js";
15
+ import { scheduleMicrotask as De } from "./task.js";
16
+ import { buildTree as xe, filterTree as ce, filterTreeWithAncestors as Fe, findNodeInTree as ye, flattenTree as Se, mapTree as de, traverseTree as ue } from "./tree.js";
17
+ import "./zod.js";
18
+ export {
19
+ o as DEFAULT_DATETIME_FORMAT,
20
+ a as DEFAULT_DATE_FORMAT,
21
+ i as DEFAULT_TIME_FORMAT,
22
+ I as EventEmitter,
23
+ m as LOCALIZED_DATETIME_FORMAT,
24
+ n as LOCALIZED_DATE_FORMAT,
25
+ j as alwaysFalse,
26
+ K as alwaysTrue,
27
+ xe as buildTree,
28
+ Ee as constantCase,
29
+ _ as createEventEmitter,
30
+ k as createThrowNotImplementedFn,
31
+ fe as decryptUsingRSA,
32
+ le as encryptUsingRSA,
33
+ ce as filterTree,
34
+ Fe as filterTreeWithAncestors,
35
+ S as filterUserFrame,
36
+ ye as findNodeInTree,
37
+ Se as flattenTree,
38
+ L as formatBytes,
39
+ s as formatDate,
40
+ p as formatDuration,
41
+ R as formatNumber,
42
+ Q as formatPath,
43
+ q as generateId,
44
+ V as getBaseName,
45
+ d as getCurrentStack,
46
+ u as getCurrentStackSync,
47
+ X as getDirName,
48
+ Y as getExtName,
49
+ T as getLocalizedDateTime,
50
+ f as getNow,
51
+ l as getNowDateString,
52
+ g as getNowDateTimeString,
53
+ E as getNowTimeString,
54
+ ne as getPinyin,
55
+ se as getPinyinInitials,
56
+ $ as getRelativePath,
57
+ w as getSanitizedErrorStack,
58
+ A as getTemporalFormats,
59
+ W as hashKey,
60
+ v as identity,
61
+ U as invokeAwaitableFn,
62
+ ee as isAbsolutePath,
63
+ C as isAsyncFunction,
64
+ c as isDeepEqual,
65
+ F as isShallowEqual,
66
+ te as joinPaths,
67
+ de as mapTree,
68
+ H as mergeWith,
69
+ re as normalizePath,
70
+ D as parseDate,
71
+ N as parseErrorStack,
72
+ oe as parsePath,
73
+ ae as pathSeparator,
74
+ ie as resolvePath,
75
+ De as scheduleMicrotask,
76
+ b as throwNotImplemented,
77
+ ue as traverseTree,
78
+ h as tryParseDate,
79
+ pe as withPinyin
80
+ };
@@ -1,30 +1,24 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import './lib.js';
3
- import { isPlainObject } from 'radashi';
4
-
5
- function hashKey(key) {
1
+ import "./lib.js";
2
+ import { isPlainObject as c } from "radashi";
3
+ function m(n) {
6
4
  return JSON.stringify(
7
- key,
8
- (_, value) => {
9
- if (isPlainObject(value)) {
10
- const stringKeys = Object.keys(value).toSorted();
11
- const symbolKeys = Object.getOwnPropertySymbols(value);
12
- const result = {};
13
- for (const key2 of stringKeys) {
14
- result[key2] = value[key2];
15
- }
16
- const symbolResult = {};
17
- for (const sym of symbolKeys) {
18
- symbolResult[sym.toString()] = value[sym];
19
- }
20
- for (const key2 of Object.keys(symbolResult).toSorted()) {
21
- result[`@@${key2}`] = symbolResult[key2];
22
- }
23
- return result;
5
+ n,
6
+ (f, o) => {
7
+ if (c(o)) {
8
+ const e = Object.keys(o).toSorted(), y = Object.getOwnPropertySymbols(o), r = {};
9
+ for (const t of e)
10
+ r[t] = o[t];
11
+ const s = {};
12
+ for (const t of y)
13
+ s[t.toString()] = o[t];
14
+ for (const t of Object.keys(s).toSorted())
15
+ r[`@@${t}`] = s[t];
16
+ return r;
24
17
  }
25
- return value;
18
+ return o;
26
19
  }
27
20
  );
28
21
  }
29
-
30
- export { hashKey };
22
+ export {
23
+ m as hashKey
24
+ };
@@ -1,10 +1,64 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import { always } from 'radashi';
3
- export { always, assign, camel as camelCase, capitalize, cluster, debounce, first, get, isArray, isBigInt, isBoolean, isDate, isEmpty, isError, isFloat, isFunction, isInt, isIntString, isMap, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isUndefined, isWeakMap, isWeakSet, dash as kebabCase, last, max, memo as memoize, min, noop, omit, once, pascal as pascalCase, pick, set, similarity, snake as snakeCase, sum, template, throttle, toFloat, toInt, trim, unique } from 'radashi';
4
- export { klona as cloneDeep } from 'klona';
5
- export { parse as decodeQueryString, stringify as encodeQueryString } from 'qs';
6
-
7
- const alwaysTrue = always(true);
8
- const alwaysFalse = always(false);
9
-
10
- export { alwaysFalse, alwaysTrue };
1
+ import { always as s } from "radashi";
2
+ import { always as r, assign as n, camel as l, capitalize as m, cluster as c, debounce as p, first as u, get as y, isArray as g, isBigInt as f, isBoolean as b, isDate as d, isEmpty as k, isError as S, isFloat as x, isFunction as w, isInt as C, isIntString as F, isMap as I, isNullish as h, isNumber as E, isObject as P, isPlainObject as j, isPrimitive as z, isPromise as B, isRegExp as D, isSet as M, isString as N, isSymbol as O, isUndefined as Q, isWeakMap as W, isWeakSet as q, dash as v, last as A, max as R, memo as T, min as U, noop as G, omit as H, once as J, pascal as K, pick as L, set as V, similarity as X, snake as Y, sum as Z, template as _, throttle as $, toFloat as ss, toInt as es, trim as is, unique as as } from "radashi";
3
+ import { klona as os } from "klona";
4
+ import { parse as ns, stringify as ls } from "qs";
5
+ const i = s(!0), a = s(!1);
6
+ export {
7
+ r as always,
8
+ a as alwaysFalse,
9
+ i as alwaysTrue,
10
+ n as assign,
11
+ l as camelCase,
12
+ m as capitalize,
13
+ os as cloneDeep,
14
+ c as cluster,
15
+ p as debounce,
16
+ ns as decodeQueryString,
17
+ ls as encodeQueryString,
18
+ u as first,
19
+ y as get,
20
+ g as isArray,
21
+ f as isBigInt,
22
+ b as isBoolean,
23
+ d as isDate,
24
+ k as isEmpty,
25
+ S as isError,
26
+ x as isFloat,
27
+ w as isFunction,
28
+ C as isInt,
29
+ F as isIntString,
30
+ I as isMap,
31
+ h as isNullish,
32
+ E as isNumber,
33
+ P as isObject,
34
+ j as isPlainObject,
35
+ z as isPrimitive,
36
+ B as isPromise,
37
+ D as isRegExp,
38
+ M as isSet,
39
+ N as isString,
40
+ O as isSymbol,
41
+ Q as isUndefined,
42
+ W as isWeakMap,
43
+ q as isWeakSet,
44
+ v as kebabCase,
45
+ A as last,
46
+ R as max,
47
+ T as memoize,
48
+ U as min,
49
+ G as noop,
50
+ H as omit,
51
+ J as once,
52
+ K as pascalCase,
53
+ L as pick,
54
+ V as set,
55
+ X as similarity,
56
+ Y as snakeCase,
57
+ Z as sum,
58
+ _ as template,
59
+ $ as throttle,
60
+ ss as toFloat,
61
+ es as toInt,
62
+ is as trim,
63
+ as as unique
64
+ };
@@ -1,16 +1,13 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import './lib.js';
3
- import { isUndefined } from 'radashi';
4
-
5
- function mergeWith(target, source, overrideExisting = false) {
6
- const validEntries = Object.entries(source).filter(([_, value]) => !isUndefined(value));
7
- for (const [key, value] of validEntries) {
8
- const targetKey = key;
9
- if (overrideExisting || isUndefined(target[targetKey])) {
10
- target[targetKey] = value;
11
- }
1
+ import "./lib.js";
2
+ import { isUndefined as o } from "radashi";
3
+ function m(e, r, f = !1) {
4
+ const s = Object.entries(r).filter(([t, i]) => !o(i));
5
+ for (const [t, i] of s) {
6
+ const n = t;
7
+ (f || o(e[n])) && (e[n] = i);
12
8
  }
13
- return target;
9
+ return e;
14
10
  }
15
-
16
- export { mergeWith };
11
+ export {
12
+ m as mergeWith
13
+ };
@@ -1,49 +1,58 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import path from 'path-browserify';
3
-
1
+ import o from "path-browserify";
4
2
  const {
5
- basename,
6
- dirname,
7
- extname,
8
- isAbsolute,
9
- join,
10
- normalize,
11
- parse,
12
- relative,
13
- resolve,
14
- format,
15
- sep: pathSeparator
16
- } = path;
17
- function getBaseName(path2, keepExt = true) {
18
- const ext = keepExt ? void 0 : extname(path2);
19
- return basename(path2, ext);
20
- }
21
- function getExtName(path2) {
22
- return extname(path2);
23
- }
24
- function getDirName(path2) {
25
- return dirname(path2);
26
- }
27
- function joinPaths(...paths) {
28
- return join(...paths);
29
- }
30
- function isAbsolutePath(path2) {
31
- return isAbsolute(path2);
32
- }
33
- function normalizePath(path2) {
34
- return normalize(path2);
35
- }
36
- function parsePath(path2) {
37
- return parse(path2);
38
- }
39
- function formatPath(pathObject) {
40
- return format(pathObject);
41
- }
42
- function getRelativePath(from, to) {
43
- return relative(from, to);
44
- }
45
- function resolvePath(...pathSegments) {
46
- return resolve(...pathSegments);
47
- }
48
-
49
- export { formatPath, getBaseName, getDirName, getExtName, getRelativePath, isAbsolutePath, joinPaths, normalizePath, parsePath, pathSeparator, resolvePath };
3
+ basename: a,
4
+ dirname: u,
5
+ extname: n,
6
+ isAbsolute: i,
7
+ join: s,
8
+ normalize: f,
9
+ parse: c,
10
+ relative: m,
11
+ resolve: h,
12
+ format: l,
13
+ sep: P
14
+ } = o;
15
+ function v(t, e = !0) {
16
+ const r = e ? void 0 : n(t);
17
+ return a(t, r);
18
+ }
19
+ function g(t) {
20
+ return n(t);
21
+ }
22
+ function x(t) {
23
+ return u(t);
24
+ }
25
+ function b(...t) {
26
+ return s(...t);
27
+ }
28
+ function N(t) {
29
+ return i(t);
30
+ }
31
+ function d(t) {
32
+ return f(t);
33
+ }
34
+ function j(t) {
35
+ return c(t);
36
+ }
37
+ function z(t) {
38
+ return l(t);
39
+ }
40
+ function A(t, e) {
41
+ return m(t, e);
42
+ }
43
+ function B(...t) {
44
+ return h(...t);
45
+ }
46
+ export {
47
+ z as formatPath,
48
+ v as getBaseName,
49
+ x as getDirName,
50
+ g as getExtName,
51
+ A as getRelativePath,
52
+ N as isAbsolutePath,
53
+ b as joinPaths,
54
+ d as normalizePath,
55
+ j as parsePath,
56
+ P as pathSeparator,
57
+ B as resolvePath
58
+ };
@@ -1,47 +1,46 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import ModernChineseDict from '@pinyin-pro/data/modern';
3
- import { addDict, pinyin } from 'pinyin-pro';
4
- import './lib.js';
5
- import { isString } from 'radashi';
6
-
7
- addDict(ModernChineseDict);
8
- const baseOptions = {
1
+ import a from "@pinyin-pro/data/modern";
2
+ import { addDict as c, pinyin as o } from "pinyin-pro";
3
+ import "./lib.js";
4
+ import { isString as f } from "radashi";
5
+ c(a);
6
+ const r = {
9
7
  type: "array",
10
8
  toneType: "none",
11
- multiple: false,
9
+ multiple: !1,
12
10
  nonZh: "consecutive",
13
11
  surname: "head"
14
12
  };
15
- function getPinyin(text) {
16
- return pinyin(
17
- text,
13
+ function u(n) {
14
+ return o(
15
+ n,
18
16
  {
19
- ...baseOptions,
17
+ ...r,
20
18
  pattern: "pinyin"
21
19
  }
22
20
  );
23
21
  }
24
- function getPinyinInitials(text) {
25
- return pinyin(
26
- text,
22
+ function m(n) {
23
+ return o(
24
+ n,
27
25
  {
28
- ...baseOptions,
26
+ ...r,
29
27
  pattern: "first"
30
28
  }
31
29
  );
32
30
  }
33
- function withPinyin(obj, ...keys) {
34
- const result = { ...obj };
35
- for (const key of keys) {
36
- const value = obj[key];
37
- if (isString(value)) {
38
- const pinyinKey = `${key}Pinyin`;
39
- const initialsKey = `${key}PinyinInitials`;
40
- result[pinyinKey] = getPinyin(value).join("");
41
- result[initialsKey] = getPinyinInitials(value).join("");
31
+ function g(n, ...s) {
32
+ const i = { ...n };
33
+ for (const t of s) {
34
+ const e = n[t];
35
+ if (f(e)) {
36
+ const p = `${t}Pinyin`, y = `${t}PinyinInitials`;
37
+ i[p] = u(e).join(""), i[y] = m(e).join("");
42
38
  }
43
39
  }
44
- return result;
40
+ return i;
45
41
  }
46
-
47
- export { getPinyin, getPinyinInitials, withPinyin };
42
+ export {
43
+ u as getPinyin,
44
+ m as getPinyinInitials,
45
+ g as withPinyin
46
+ };
@@ -1,39 +1,31 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import JSEncrypt from 'jsencrypt';
3
- import './lib.js';
4
- import { isNullish } from 'radashi';
5
-
6
- function encryptUsingRSA(value, publicKey) {
7
- if (isNullish(value)) {
8
- throw new Error(`Failed to encrypt data [${value}] using RSA`);
9
- }
10
- if (!publicKey || publicKey.trim() === "") {
11
- throw new Error(`Failed to encrypt data [${value}] using RSA`);
12
- }
13
- const rsa = new JSEncrypt();
14
- rsa.setPublicKey(publicKey);
15
- const encrypted = rsa.encrypt(value);
16
- if (!encrypted) {
17
- console.error("Failed to encrypt data using RSA", value);
18
- throw new Error(`Failed to encrypt data [${value}] using RSA`);
19
- }
20
- return encrypted;
1
+ import i from "jsencrypt";
2
+ import "./lib.js";
3
+ import { isNullish as e } from "radashi";
4
+ function a(r, t) {
5
+ if (e(r))
6
+ throw new Error(`Failed to encrypt data [${r}] using RSA`);
7
+ if (!t || t.trim() === "")
8
+ throw new Error(`Failed to encrypt data [${r}] using RSA`);
9
+ const n = new i();
10
+ n.setPublicKey(t);
11
+ const o = n.encrypt(r);
12
+ if (!o)
13
+ throw console.error("Failed to encrypt data using RSA", r), new Error(`Failed to encrypt data [${r}] using RSA`);
14
+ return o;
21
15
  }
22
- function decryptUsingRSA(value, privateKey) {
23
- if (isNullish(value)) {
24
- throw new Error(`Failed to decrypt data [${value}] using RSA`);
25
- }
26
- if (!privateKey || privateKey.trim() === "") {
27
- throw new Error(`Failed to decrypt data [${value}] using RSA`);
28
- }
29
- const rsa = new JSEncrypt();
30
- rsa.setPrivateKey(privateKey);
31
- const decrypted = rsa.decrypt(value);
32
- if (!decrypted) {
33
- console.error("Failed to decrypt data using RSA", value);
34
- throw new Error(`Failed to decrypt data [${value}] using RSA`);
35
- }
36
- return decrypted;
16
+ function p(r, t) {
17
+ if (e(r))
18
+ throw new Error(`Failed to decrypt data [${r}] using RSA`);
19
+ if (!t || t.trim() === "")
20
+ throw new Error(`Failed to decrypt data [${r}] using RSA`);
21
+ const n = new i();
22
+ n.setPrivateKey(t);
23
+ const o = n.decrypt(r);
24
+ if (!o)
25
+ throw console.error("Failed to decrypt data using RSA", r), new Error(`Failed to decrypt data [${r}] using RSA`);
26
+ return o;
37
27
  }
38
-
39
- export { decryptUsingRSA, encryptUsingRSA };
28
+ export {
29
+ p as decryptUsingRSA,
30
+ a as encryptUsingRSA
31
+ };
@@ -1,9 +1,8 @@
1
- /*! @vef-framework/shared v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.127Z */
2
- import './lib.js';
3
- import { snake } from 'radashi';
4
-
5
- function constantCase(value) {
6
- return snake(value).toUpperCase();
1
+ import "./lib.js";
2
+ import { snake as o } from "radashi";
3
+ function n(t) {
4
+ return o(t).toUpperCase();
7
5
  }
8
-
9
- export { constantCase };
6
+ export {
7
+ n as constantCase
8
+ };