@vef-framework/shared 2.0.9 → 2.0.11
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/cjs/index.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/table.cjs +1 -0
- package/dist/es/index.js +52 -50
- package/dist/es/utils/index.js +29 -27
- package/dist/es/utils/table.js +15 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/table.d.ts +24 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./color/index.cjs");require("./constants/index.cjs");require("./types/index.cjs");require("./utils/index.cjs");const r=require("./color/color-ops.cjs"),d=require("./color/name.cjs"),P=require("./color/palette.cjs"),l=require("./constants/color-names.cjs"),u=require("./constants/color-palettes.cjs"),t=require("./utils/chrono.cjs"),c=require("./utils/equal.cjs"),o=require("./utils/error.cjs"),m=require("./utils/event.cjs"),b=require("./utils/format.cjs"),a=require("./utils/function.cjs"),f=require("./utils/id.cjs"),O=require("./utils/key.cjs"),j=require("klona"),g=require("qs"),e=require("radashi"),p=require("./utils/lib.cjs"),T=require("./utils/object.cjs"),i=require("./utils/path.cjs"),s=require("./utils/pinyin.cjs"),y=require("./utils/security.cjs"),E=require("./utils/string.cjs"),h=require("./utils/task.cjs"),n=require("./utils/tree.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./color/index.cjs");require("./constants/index.cjs");require("./types/index.cjs");require("./utils/index.cjs");const r=require("./color/color-ops.cjs"),d=require("./color/name.cjs"),P=require("./color/palette.cjs"),l=require("./constants/color-names.cjs"),u=require("./constants/color-palettes.cjs"),t=require("./utils/chrono.cjs"),c=require("./utils/equal.cjs"),o=require("./utils/error.cjs"),m=require("./utils/event.cjs"),b=require("./utils/format.cjs"),a=require("./utils/function.cjs"),f=require("./utils/id.cjs"),O=require("./utils/key.cjs"),j=require("klona"),g=require("qs"),e=require("radashi"),p=require("./utils/lib.cjs"),T=require("./utils/object.cjs"),i=require("./utils/path.cjs"),s=require("./utils/pinyin.cjs"),y=require("./utils/security.cjs"),E=require("./utils/string.cjs"),h=require("./utils/table.cjs"),A=require("./utils/task.cjs"),n=require("./utils/tree.cjs"),D=require("zod");exports.convertHslToHex=r.convertHslToHex;exports.convertTransparentToOpaque=r.convertTransparentToOpaque;exports.getColorDifference=r.getColorDifference;exports.isValidColor=r.isValidColor;exports.isWhiteColor=r.isWhiteColor;exports.mixColor=r.mixColor;exports.setColorAlpha=r.setColorAlpha;exports.toHexColor=r.toHexColor;exports.toHslColor=r.toHslColor;exports.toHsvColor=r.toHsvColor;exports.toRgbColor=r.toRgbColor;exports.getColorName=d.getColorName;exports.getColorPalette=P.getColorPalette;exports.colorEntries=l.colorEntries;exports.colorNameMap=l.colorNameMap;exports.colorPaletteMap=u.colorPaletteMap;exports.colorPalettes=u.colorPalettes;exports.DEFAULT_DATETIME_FORMAT=t.DEFAULT_DATETIME_FORMAT;exports.DEFAULT_DATE_FORMAT=t.DEFAULT_DATE_FORMAT;exports.DEFAULT_TIME_FORMAT=t.DEFAULT_TIME_FORMAT;exports.LOCALIZED_DATETIME_FORMAT=t.LOCALIZED_DATETIME_FORMAT;exports.LOCALIZED_DATE_FORMAT=t.LOCALIZED_DATE_FORMAT;exports.formatDate=t.formatDate;exports.formatDuration=t.formatDuration;exports.getLocalizedDateTime=t.getLocalizedDateTime;exports.getNow=t.getNow;exports.getNowDateString=t.getNowDateString;exports.getNowDateTimeString=t.getNowDateTimeString;exports.getNowTimeString=t.getNowTimeString;exports.getTemporalFormats=t.getTemporalFormats;exports.parseDate=t.parseDate;exports.tryParseDate=t.tryParseDate;exports.isDeepEqual=c.isDeepEqual;exports.isShallowEqual=c.isShallowEqual;exports.filterUserFrame=o.filterUserFrame;exports.getCurrentStack=o.getCurrentStack;exports.getCurrentStackSync=o.getCurrentStackSync;exports.getSanitizedErrorStack=o.getSanitizedErrorStack;exports.parseErrorStack=o.parseErrorStack;exports.EventEmitter=m.EventEmitter;exports.createEventEmitter=m.createEventEmitter;exports.formatBytes=b.formatBytes;exports.formatNumber=b.formatNumber;exports.createThrowNotImplementedFn=a.createThrowNotImplementedFn;exports.identity=a.identity;exports.invokeAwaitableFn=a.invokeAwaitableFn;exports.isAsyncFunction=a.isAsyncFunction;exports.throwNotImplemented=a.throwNotImplemented;exports.generateId=f.generateId;exports.hashKey=O.hashKey;Object.defineProperty(exports,"cloneDeep",{enumerable:!0,get:()=>j.klona});Object.defineProperty(exports,"decodeQueryString",{enumerable:!0,get:()=>g.parse});Object.defineProperty(exports,"encodeQueryString",{enumerable:!0,get:()=>g.stringify});Object.defineProperty(exports,"always",{enumerable:!0,get:()=>e.always});Object.defineProperty(exports,"assign",{enumerable:!0,get:()=>e.assign});Object.defineProperty(exports,"camelCase",{enumerable:!0,get:()=>e.camel});Object.defineProperty(exports,"capitalize",{enumerable:!0,get:()=>e.capitalize});Object.defineProperty(exports,"cluster",{enumerable:!0,get:()=>e.cluster});Object.defineProperty(exports,"debounce",{enumerable:!0,get:()=>e.debounce});Object.defineProperty(exports,"first",{enumerable:!0,get:()=>e.first});Object.defineProperty(exports,"get",{enumerable:!0,get:()=>e.get});Object.defineProperty(exports,"isArray",{enumerable:!0,get:()=>e.isArray});Object.defineProperty(exports,"isBigInt",{enumerable:!0,get:()=>e.isBigInt});Object.defineProperty(exports,"isBoolean",{enumerable:!0,get:()=>e.isBoolean});Object.defineProperty(exports,"isDate",{enumerable:!0,get:()=>e.isDate});Object.defineProperty(exports,"isEmpty",{enumerable:!0,get:()=>e.isEmpty});Object.defineProperty(exports,"isError",{enumerable:!0,get:()=>e.isError});Object.defineProperty(exports,"isFloat",{enumerable:!0,get:()=>e.isFloat});Object.defineProperty(exports,"isFunction",{enumerable:!0,get:()=>e.isFunction});Object.defineProperty(exports,"isInt",{enumerable:!0,get:()=>e.isInt});Object.defineProperty(exports,"isIntString",{enumerable:!0,get:()=>e.isIntString});Object.defineProperty(exports,"isMap",{enumerable:!0,get:()=>e.isMap});Object.defineProperty(exports,"isNullish",{enumerable:!0,get:()=>e.isNullish});Object.defineProperty(exports,"isNumber",{enumerable:!0,get:()=>e.isNumber});Object.defineProperty(exports,"isObject",{enumerable:!0,get:()=>e.isObject});Object.defineProperty(exports,"isPlainObject",{enumerable:!0,get:()=>e.isPlainObject});Object.defineProperty(exports,"isPrimitive",{enumerable:!0,get:()=>e.isPrimitive});Object.defineProperty(exports,"isPromise",{enumerable:!0,get:()=>e.isPromise});Object.defineProperty(exports,"isRegExp",{enumerable:!0,get:()=>e.isRegExp});Object.defineProperty(exports,"isSet",{enumerable:!0,get:()=>e.isSet});Object.defineProperty(exports,"isString",{enumerable:!0,get:()=>e.isString});Object.defineProperty(exports,"isSymbol",{enumerable:!0,get:()=>e.isSymbol});Object.defineProperty(exports,"isUndefined",{enumerable:!0,get:()=>e.isUndefined});Object.defineProperty(exports,"isWeakMap",{enumerable:!0,get:()=>e.isWeakMap});Object.defineProperty(exports,"isWeakSet",{enumerable:!0,get:()=>e.isWeakSet});Object.defineProperty(exports,"kebabCase",{enumerable:!0,get:()=>e.dash});Object.defineProperty(exports,"last",{enumerable:!0,get:()=>e.last});Object.defineProperty(exports,"max",{enumerable:!0,get:()=>e.max});Object.defineProperty(exports,"memoize",{enumerable:!0,get:()=>e.memo});Object.defineProperty(exports,"min",{enumerable:!0,get:()=>e.min});Object.defineProperty(exports,"noop",{enumerable:!0,get:()=>e.noop});Object.defineProperty(exports,"omit",{enumerable:!0,get:()=>e.omit});Object.defineProperty(exports,"once",{enumerable:!0,get:()=>e.once});Object.defineProperty(exports,"pascalCase",{enumerable:!0,get:()=>e.pascal});Object.defineProperty(exports,"pick",{enumerable:!0,get:()=>e.pick});Object.defineProperty(exports,"set",{enumerable:!0,get:()=>e.set});Object.defineProperty(exports,"similarity",{enumerable:!0,get:()=>e.similarity});Object.defineProperty(exports,"snakeCase",{enumerable:!0,get:()=>e.snake});Object.defineProperty(exports,"sum",{enumerable:!0,get:()=>e.sum});Object.defineProperty(exports,"template",{enumerable:!0,get:()=>e.template});Object.defineProperty(exports,"throttle",{enumerable:!0,get:()=>e.throttle});Object.defineProperty(exports,"toFloat",{enumerable:!0,get:()=>e.toFloat});Object.defineProperty(exports,"toInt",{enumerable:!0,get:()=>e.toInt});Object.defineProperty(exports,"trim",{enumerable:!0,get:()=>e.trim});Object.defineProperty(exports,"unique",{enumerable:!0,get:()=>e.unique});exports.alwaysFalse=p.alwaysFalse;exports.alwaysTrue=p.alwaysTrue;exports.mergeWith=T.mergeWith;exports.formatPath=i.formatPath;exports.getBaseName=i.getBaseName;exports.getDirName=i.getDirName;exports.getExtName=i.getExtName;exports.getRelativePath=i.getRelativePath;exports.isAbsolutePath=i.isAbsolutePath;exports.joinPaths=i.joinPaths;exports.normalizePath=i.normalizePath;exports.parsePath=i.parsePath;exports.pathSeparator=i.pathSeparator;exports.resolvePath=i.resolvePath;exports.getPinyin=s.getPinyin;exports.getPinyinInitials=s.getPinyinInitials;exports.withPinyin=s.withPinyin;exports.decryptUsingRSA=y.decryptUsingRSA;exports.encryptUsingRSA=y.encryptUsingRSA;exports.constantCase=E.constantCase;exports.shouldUpdateByKeys=h.shouldUpdateByKeys;exports.scheduleMicrotask=A.scheduleMicrotask;exports.buildTree=n.buildTree;exports.filterTree=n.filterTree;exports.filterTreeWithAncestors=n.filterTreeWithAncestors;exports.findNodeInTree=n.findNodeInTree;exports.flattenTree=n.flattenTree;exports.mapTree=n.mapTree;exports.traverseTree=n.traverseTree;Object.defineProperty(exports,"z",{enumerable:!0,get:()=>D.z});
|
package/dist/cjs/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chrono.cjs"),o=require("./equal.cjs"),a=require("./error.cjs"),s=require("./event.cjs"),T=require("./format.cjs"),i=require("./function.cjs"),m=require("./id.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chrono.cjs"),o=require("./equal.cjs"),a=require("./error.cjs"),s=require("./event.cjs"),T=require("./format.cjs"),i=require("./function.cjs"),m=require("./id.cjs"),u=require("./key.cjs"),c=require("./lib.cjs"),g=require("./object.cjs"),t=require("./path.cjs"),n=require("./pinyin.cjs"),l=require("./security.cjs"),E=require("./string.cjs"),A=require("./table.cjs"),h=require("./task.cjs"),r=require("./tree.cjs");require("./zod.cjs");exports.DEFAULT_DATETIME_FORMAT=e.DEFAULT_DATETIME_FORMAT;exports.DEFAULT_DATE_FORMAT=e.DEFAULT_DATE_FORMAT;exports.DEFAULT_TIME_FORMAT=e.DEFAULT_TIME_FORMAT;exports.LOCALIZED_DATETIME_FORMAT=e.LOCALIZED_DATETIME_FORMAT;exports.LOCALIZED_DATE_FORMAT=e.LOCALIZED_DATE_FORMAT;exports.formatDate=e.formatDate;exports.formatDuration=e.formatDuration;exports.getLocalizedDateTime=e.getLocalizedDateTime;exports.getNow=e.getNow;exports.getNowDateString=e.getNowDateString;exports.getNowDateTimeString=e.getNowDateTimeString;exports.getNowTimeString=e.getNowTimeString;exports.getTemporalFormats=e.getTemporalFormats;exports.parseDate=e.parseDate;exports.tryParseDate=e.tryParseDate;exports.isDeepEqual=o.isDeepEqual;exports.isShallowEqual=o.isShallowEqual;exports.filterUserFrame=a.filterUserFrame;exports.getCurrentStack=a.getCurrentStack;exports.getCurrentStackSync=a.getCurrentStackSync;exports.getSanitizedErrorStack=a.getSanitizedErrorStack;exports.parseErrorStack=a.parseErrorStack;exports.EventEmitter=s.EventEmitter;exports.createEventEmitter=s.createEventEmitter;exports.formatBytes=T.formatBytes;exports.formatNumber=T.formatNumber;exports.createThrowNotImplementedFn=i.createThrowNotImplementedFn;exports.identity=i.identity;exports.invokeAwaitableFn=i.invokeAwaitableFn;exports.isAsyncFunction=i.isAsyncFunction;exports.throwNotImplemented=i.throwNotImplemented;exports.generateId=m.generateId;exports.hashKey=u.hashKey;exports.alwaysFalse=c.alwaysFalse;exports.alwaysTrue=c.alwaysTrue;exports.mergeWith=g.mergeWith;exports.formatPath=t.formatPath;exports.getBaseName=t.getBaseName;exports.getDirName=t.getDirName;exports.getExtName=t.getExtName;exports.getRelativePath=t.getRelativePath;exports.isAbsolutePath=t.isAbsolutePath;exports.joinPaths=t.joinPaths;exports.normalizePath=t.normalizePath;exports.parsePath=t.parsePath;exports.pathSeparator=t.pathSeparator;exports.resolvePath=t.resolvePath;exports.getPinyin=n.getPinyin;exports.getPinyinInitials=n.getPinyinInitials;exports.withPinyin=n.withPinyin;exports.decryptUsingRSA=l.decryptUsingRSA;exports.encryptUsingRSA=l.encryptUsingRSA;exports.constantCase=E.constantCase;exports.shouldUpdateByKeys=A.shouldUpdateByKeys;exports.scheduleMicrotask=h.scheduleMicrotask;exports.buildTree=r.buildTree;exports.filterTree=r.filterTree;exports.filterTreeWithAncestors=r.filterTreeWithAncestors;exports.findNodeInTree=r.findNodeInTree;exports.flattenTree=r.flattenTree;exports.mapTree=r.mapTree;exports.traverseTree=r.traverseTree;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./equal.cjs");require("./lib.cjs");const n=require("radashi"),d={reference:(e,s)=>e===s,shallow:c.isShallowEqual,deep:c.isDeepEqual};function p(e,...s){const r=n.isPlainObject(e)&&!n.isArray(e)&&"compare"in e,o=r?e:{},t=r?s:[e,...s],i=d[o.compare??"reference"];return(l,u)=>t.some(a=>!i(l?.[a],u?.[a]))}exports.shouldUpdateByKeys=p;
|
package/dist/es/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import "./types/index.js";
|
|
|
4
4
|
import "./utils/index.js";
|
|
5
5
|
import { convertHslToHex as s, convertTransparentToOpaque as m, getColorDifference as n, isValidColor as l, isWhiteColor as p, mixColor as f, setColorAlpha as c, toHexColor as g, toHslColor as x, toHsvColor as T, toRgbColor as E } from "./color/color-ops.js";
|
|
6
6
|
import { getColorName as u } from "./color/name.js";
|
|
7
|
-
import { getColorPalette as
|
|
8
|
-
import { colorEntries as
|
|
7
|
+
import { getColorPalette as A } from "./color/palette.js";
|
|
8
|
+
import { colorEntries as D, colorNameMap as C } from "./constants/color-names.js";
|
|
9
9
|
import { colorPaletteMap as F, colorPalettes as P } from "./constants/color-palettes.js";
|
|
10
|
-
import { DEFAULT_DATETIME_FORMAT as I, DEFAULT_DATE_FORMAT as k, DEFAULT_TIME_FORMAT as M, LOCALIZED_DATETIME_FORMAT as b, LOCALIZED_DATE_FORMAT as w, formatDate as v, formatDuration as O, getLocalizedDateTime as R, getNow as _, getNowDateString as L, getNowDateTimeString as U, getNowTimeString as z, getTemporalFormats as
|
|
11
|
-
import { isDeepEqual as j, isShallowEqual as
|
|
12
|
-
import { filterUserFrame as
|
|
10
|
+
import { DEFAULT_DATETIME_FORMAT as I, DEFAULT_DATE_FORMAT as k, DEFAULT_TIME_FORMAT as M, LOCALIZED_DATETIME_FORMAT as b, LOCALIZED_DATE_FORMAT as w, formatDate as v, formatDuration as O, getLocalizedDateTime as R, getNow as _, getNowDateString as L, getNowDateTimeString as U, getNowTimeString as z, getTemporalFormats as B, parseDate as H, tryParseDate as W } from "./utils/chrono.js";
|
|
11
|
+
import { isDeepEqual as j, isShallowEqual as K } from "./utils/equal.js";
|
|
12
|
+
import { filterUserFrame as Z, getCurrentStack as V, getCurrentStackSync as G, getSanitizedErrorStack as J, parseErrorStack as X } from "./utils/error.js";
|
|
13
13
|
import { EventEmitter as $, createEventEmitter as ee } from "./utils/event.js";
|
|
14
14
|
import { formatBytes as re, formatNumber as oe } from "./utils/format.js";
|
|
15
15
|
import { createThrowNotImplementedFn as ie, identity as se, invokeAwaitableFn as me, isAsyncFunction as ne, throwNotImplemented as le } from "./utils/function.js";
|
|
@@ -17,16 +17,17 @@ import { generateId as fe } from "./utils/id.js";
|
|
|
17
17
|
import { hashKey as ge } from "./utils/key.js";
|
|
18
18
|
import { klona as Te } from "klona";
|
|
19
19
|
import { parse as he, stringify as ue } from "qs";
|
|
20
|
-
import { always as
|
|
21
|
-
import { alwaysFalse as
|
|
22
|
-
import { mergeWith as
|
|
23
|
-
import { formatPath as
|
|
20
|
+
import { always as Ae, assign as de, camel as De, capitalize as Ce, cluster as Se, debounce as Fe, first as Pe, get as Ne, isArray as Ie, isBigInt as ke, isBoolean as Me, isDate as be, isEmpty as we, isError as ve, isFloat as Oe, isFunction as Re, isInt as _e, isIntString as Le, isMap as Ue, isNullish as ze, isNumber as Be, isObject as He, isPlainObject as We, isPrimitive as qe, isPromise as je, isRegExp as Ke, isSet as Qe, isString as Ze, isSymbol as Ve, isUndefined as Ge, isWeakMap as Je, isWeakSet as Xe, dash as Ye, last as $e, max as et, memo as tt, min as rt, noop as ot, omit as at, once as it, pascal as st, pick as mt, set as nt, similarity as lt, snake as pt, sum as ft, template as ct, throttle as gt, toFloat as xt, toInt as Tt, trim as Et, unique as ht } from "radashi";
|
|
21
|
+
import { alwaysFalse as yt, alwaysTrue as At } from "./utils/lib.js";
|
|
22
|
+
import { mergeWith as Dt } from "./utils/object.js";
|
|
23
|
+
import { formatPath as St, getBaseName as Ft, getDirName as Pt, getExtName as Nt, getRelativePath as It, isAbsolutePath as kt, joinPaths as Mt, normalizePath as bt, parsePath as wt, pathSeparator as vt, resolvePath as Ot } from "./utils/path.js";
|
|
24
24
|
import { getPinyin as _t, getPinyinInitials as Lt, withPinyin as Ut } from "./utils/pinyin.js";
|
|
25
|
-
import { decryptUsingRSA as
|
|
26
|
-
import { constantCase as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
25
|
+
import { decryptUsingRSA as Bt, encryptUsingRSA as Ht } from "./utils/security.js";
|
|
26
|
+
import { constantCase as qt } from "./utils/string.js";
|
|
27
|
+
import { shouldUpdateByKeys as Kt } from "./utils/table.js";
|
|
28
|
+
import { scheduleMicrotask as Zt } from "./utils/task.js";
|
|
29
|
+
import { buildTree as Gt, filterTree as Jt, filterTreeWithAncestors as Xt, findNodeInTree as Yt, flattenTree as $t, mapTree as er, traverseTree as tr } from "./utils/tree.js";
|
|
30
|
+
import { z as or } from "zod";
|
|
30
31
|
export {
|
|
31
32
|
I as DEFAULT_DATETIME_FORMAT,
|
|
32
33
|
k as DEFAULT_DATE_FORMAT,
|
|
@@ -34,46 +35,46 @@ export {
|
|
|
34
35
|
$ as EventEmitter,
|
|
35
36
|
b as LOCALIZED_DATETIME_FORMAT,
|
|
36
37
|
w as LOCALIZED_DATE_FORMAT,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
Ae as always,
|
|
39
|
+
yt as alwaysFalse,
|
|
40
|
+
At as alwaysTrue,
|
|
41
|
+
de as assign,
|
|
42
|
+
Gt as buildTree,
|
|
43
|
+
De as camelCase,
|
|
44
|
+
Ce as capitalize,
|
|
44
45
|
Te as cloneDeep,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
Se as cluster,
|
|
47
|
+
D as colorEntries,
|
|
48
|
+
C as colorNameMap,
|
|
48
49
|
F as colorPaletteMap,
|
|
49
50
|
P as colorPalettes,
|
|
50
|
-
|
|
51
|
+
qt as constantCase,
|
|
51
52
|
s as convertHslToHex,
|
|
52
53
|
m as convertTransparentToOpaque,
|
|
53
54
|
ee as createEventEmitter,
|
|
54
55
|
ie as createThrowNotImplementedFn,
|
|
55
56
|
Fe as debounce,
|
|
56
57
|
he as decodeQueryString,
|
|
57
|
-
|
|
58
|
+
Bt as decryptUsingRSA,
|
|
58
59
|
ue as encodeQueryString,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
Ht as encryptUsingRSA,
|
|
61
|
+
Jt as filterTree,
|
|
62
|
+
Xt as filterTreeWithAncestors,
|
|
63
|
+
Z as filterUserFrame,
|
|
64
|
+
Yt as findNodeInTree,
|
|
64
65
|
Pe as first,
|
|
65
|
-
|
|
66
|
+
$t as flattenTree,
|
|
66
67
|
re as formatBytes,
|
|
67
68
|
v as formatDate,
|
|
68
69
|
O as formatDuration,
|
|
69
70
|
oe as formatNumber,
|
|
70
|
-
|
|
71
|
+
St as formatPath,
|
|
71
72
|
fe as generateId,
|
|
72
73
|
Ne as get,
|
|
73
74
|
Ft as getBaseName,
|
|
74
75
|
n as getColorDifference,
|
|
75
76
|
u as getColorName,
|
|
76
|
-
|
|
77
|
+
A as getColorPalette,
|
|
77
78
|
V as getCurrentStack,
|
|
78
79
|
G as getCurrentStackSync,
|
|
79
80
|
Pt as getDirName,
|
|
@@ -87,7 +88,7 @@ export {
|
|
|
87
88
|
Lt as getPinyinInitials,
|
|
88
89
|
It as getRelativePath,
|
|
89
90
|
J as getSanitizedErrorStack,
|
|
90
|
-
|
|
91
|
+
B as getTemporalFormats,
|
|
91
92
|
ge as hashKey,
|
|
92
93
|
se as identity,
|
|
93
94
|
me as invokeAwaitableFn,
|
|
@@ -106,15 +107,15 @@ export {
|
|
|
106
107
|
Le as isIntString,
|
|
107
108
|
Ue as isMap,
|
|
108
109
|
ze as isNullish,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
Be as isNumber,
|
|
111
|
+
He as isObject,
|
|
112
|
+
We as isPlainObject,
|
|
113
|
+
qe as isPrimitive,
|
|
113
114
|
je as isPromise,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
Ke as isRegExp,
|
|
116
|
+
Qe as isSet,
|
|
117
|
+
K as isShallowEqual,
|
|
118
|
+
Ze as isString,
|
|
118
119
|
Ve as isSymbol,
|
|
119
120
|
Ge as isUndefined,
|
|
120
121
|
l as isValidColor,
|
|
@@ -124,26 +125,27 @@ export {
|
|
|
124
125
|
Mt as joinPaths,
|
|
125
126
|
Ye as kebabCase,
|
|
126
127
|
$e as last,
|
|
127
|
-
|
|
128
|
+
er as mapTree,
|
|
128
129
|
et as max,
|
|
129
130
|
tt as memoize,
|
|
130
|
-
|
|
131
|
+
Dt as mergeWith,
|
|
131
132
|
rt as min,
|
|
132
133
|
f as mixColor,
|
|
133
134
|
ot as noop,
|
|
134
135
|
bt as normalizePath,
|
|
135
136
|
at as omit,
|
|
136
137
|
it as once,
|
|
137
|
-
|
|
138
|
+
H as parseDate,
|
|
138
139
|
X as parseErrorStack,
|
|
139
140
|
wt as parsePath,
|
|
140
141
|
st as pascalCase,
|
|
141
142
|
vt as pathSeparator,
|
|
142
143
|
mt as pick,
|
|
143
144
|
Ot as resolvePath,
|
|
144
|
-
|
|
145
|
+
Zt as scheduleMicrotask,
|
|
145
146
|
nt as set,
|
|
146
147
|
c as setColorAlpha,
|
|
148
|
+
Kt as shouldUpdateByKeys,
|
|
147
149
|
lt as similarity,
|
|
148
150
|
pt as snakeCase,
|
|
149
151
|
ft as sum,
|
|
@@ -156,10 +158,10 @@ export {
|
|
|
156
158
|
T as toHsvColor,
|
|
157
159
|
Tt as toInt,
|
|
158
160
|
E as toRgbColor,
|
|
159
|
-
|
|
161
|
+
tr as traverseTree,
|
|
160
162
|
Et as trim,
|
|
161
|
-
|
|
163
|
+
W as tryParseDate,
|
|
162
164
|
ht as unique,
|
|
163
165
|
Ut as withPinyin,
|
|
164
|
-
|
|
166
|
+
or as z
|
|
165
167
|
};
|
package/dist/es/utils/index.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
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
|
|
2
|
-
import { isDeepEqual as c, isShallowEqual as
|
|
3
|
-
import { filterUserFrame as
|
|
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 h, tryParseDate as x } from "./chrono.js";
|
|
2
|
+
import { isDeepEqual as c, isShallowEqual as y } from "./equal.js";
|
|
3
|
+
import { filterUserFrame as d, getCurrentStack as S, getCurrentStackSync as u, getSanitizedErrorStack as w, parseErrorStack as N } from "./error.js";
|
|
4
4
|
import { EventEmitter as I, createEventEmitter as _ } from "./event.js";
|
|
5
5
|
import { formatBytes as L, formatNumber as R } from "./format.js";
|
|
6
|
-
import { createThrowNotImplementedFn as
|
|
7
|
-
import { generateId as
|
|
8
|
-
import { hashKey as
|
|
9
|
-
import { alwaysFalse as
|
|
6
|
+
import { createThrowNotImplementedFn as U, identity as k, invokeAwaitableFn as v, isAsyncFunction as C, throwNotImplemented as b } from "./function.js";
|
|
7
|
+
import { generateId as B } from "./id.js";
|
|
8
|
+
import { hashKey as K } from "./key.js";
|
|
9
|
+
import { alwaysFalse as Z, alwaysTrue as j } from "./lib.js";
|
|
10
10
|
import { mergeWith as H } from "./object.js";
|
|
11
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
12
|
import { getPinyin as ne, getPinyinInitials as se, withPinyin as pe } from "./pinyin.js";
|
|
13
13
|
import { decryptUsingRSA as fe, encryptUsingRSA as le } from "./security.js";
|
|
14
14
|
import { constantCase as Ee } from "./string.js";
|
|
15
|
+
import { shouldUpdateByKeys as he } from "./table.js";
|
|
15
16
|
import { scheduleMicrotask as De } from "./task.js";
|
|
16
|
-
import { buildTree as
|
|
17
|
+
import { buildTree as ye, filterTree as Fe, filterTreeWithAncestors as de, findNodeInTree as Se, flattenTree as ue, mapTree as we, traverseTree as Ne } from "./tree.js";
|
|
17
18
|
import "./zod.js";
|
|
18
19
|
export {
|
|
19
20
|
o as DEFAULT_DATETIME_FORMAT,
|
|
@@ -22,27 +23,27 @@ export {
|
|
|
22
23
|
I as EventEmitter,
|
|
23
24
|
m as LOCALIZED_DATETIME_FORMAT,
|
|
24
25
|
n as LOCALIZED_DATE_FORMAT,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Z as alwaysFalse,
|
|
27
|
+
j as alwaysTrue,
|
|
28
|
+
ye as buildTree,
|
|
28
29
|
Ee as constantCase,
|
|
29
30
|
_ as createEventEmitter,
|
|
30
|
-
|
|
31
|
+
U as createThrowNotImplementedFn,
|
|
31
32
|
fe as decryptUsingRSA,
|
|
32
33
|
le as encryptUsingRSA,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
Fe as filterTree,
|
|
35
|
+
de as filterTreeWithAncestors,
|
|
36
|
+
d as filterUserFrame,
|
|
37
|
+
Se as findNodeInTree,
|
|
38
|
+
ue as flattenTree,
|
|
38
39
|
L as formatBytes,
|
|
39
40
|
s as formatDate,
|
|
40
41
|
p as formatDuration,
|
|
41
42
|
R as formatNumber,
|
|
42
43
|
Q as formatPath,
|
|
43
|
-
|
|
44
|
+
B as generateId,
|
|
44
45
|
V as getBaseName,
|
|
45
|
-
|
|
46
|
+
S as getCurrentStack,
|
|
46
47
|
u as getCurrentStackSync,
|
|
47
48
|
X as getDirName,
|
|
48
49
|
Y as getExtName,
|
|
@@ -56,25 +57,26 @@ export {
|
|
|
56
57
|
$ as getRelativePath,
|
|
57
58
|
w as getSanitizedErrorStack,
|
|
58
59
|
A as getTemporalFormats,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
K as hashKey,
|
|
61
|
+
k as identity,
|
|
62
|
+
v as invokeAwaitableFn,
|
|
62
63
|
ee as isAbsolutePath,
|
|
63
64
|
C as isAsyncFunction,
|
|
64
65
|
c as isDeepEqual,
|
|
65
|
-
|
|
66
|
+
y as isShallowEqual,
|
|
66
67
|
te as joinPaths,
|
|
67
|
-
|
|
68
|
+
we as mapTree,
|
|
68
69
|
H as mergeWith,
|
|
69
70
|
re as normalizePath,
|
|
70
|
-
|
|
71
|
+
h as parseDate,
|
|
71
72
|
N as parseErrorStack,
|
|
72
73
|
oe as parsePath,
|
|
73
74
|
ae as pathSeparator,
|
|
74
75
|
ie as resolvePath,
|
|
75
76
|
De as scheduleMicrotask,
|
|
77
|
+
he as shouldUpdateByKeys,
|
|
76
78
|
b as throwNotImplemented,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
Ne as traverseTree,
|
|
80
|
+
x as tryParseDate,
|
|
79
81
|
pe as withPinyin
|
|
80
82
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isDeepEqual as i, isShallowEqual as p } from "./equal.js";
|
|
2
|
+
import "./lib.js";
|
|
3
|
+
import { isPlainObject as l, isArray as f } from "radashi";
|
|
4
|
+
const u = {
|
|
5
|
+
reference: (e, o) => e === o,
|
|
6
|
+
shallow: p,
|
|
7
|
+
deep: i
|
|
8
|
+
};
|
|
9
|
+
function w(e, ...o) {
|
|
10
|
+
const c = l(e) && !f(e) && "compare" in e, n = c ? e : {}, s = c ? o : [e, ...o], a = u[n.compare ?? "reference"];
|
|
11
|
+
return (m, t) => s.some((r) => !a(m?.[r], t?.[r]));
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
w as shouldUpdateByKeys
|
|
15
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnyObject } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Comparison mode for reference values
|
|
4
|
+
*/
|
|
5
|
+
export type CompareMode = "reference" | "shallow" | "deep";
|
|
6
|
+
/**
|
|
7
|
+
* Options for shouldUpdateByKeys
|
|
8
|
+
*/
|
|
9
|
+
export interface ShouldUpdateByKeysOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Comparison mode for reference values
|
|
12
|
+
* - "reference": Use strict equality (===)
|
|
13
|
+
* - "shallow": Use shallow comparison
|
|
14
|
+
* - "deep": Use deep comparison
|
|
15
|
+
* @default "reference"
|
|
16
|
+
*/
|
|
17
|
+
compare?: CompareMode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates a function that checks if any specified keys differ between two objects.
|
|
21
|
+
* Useful for Table's shouldCellUpdate prop to optimize re-renders.
|
|
22
|
+
*/
|
|
23
|
+
export declare function shouldUpdateByKeys<T = AnyObject, const K extends keyof T = keyof T>(options: ShouldUpdateByKeysOptions, ...keys: K[]): (next: T, prev: T) => boolean;
|
|
24
|
+
export declare function shouldUpdateByKeys<T = AnyObject, const K extends keyof T = keyof T>(...keys: K[]): (next: T, prev: T) => boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vef-framework/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.11",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Shared utilities for VEF framework",
|
|
7
7
|
"author": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"radashi": "^12.7.1",
|
|
60
60
|
"stacktrace-js": "^2.0.2",
|
|
61
61
|
"tiny-lru": "^11.4.5",
|
|
62
|
-
"type-fest": "^5.
|
|
62
|
+
"type-fest": "^5.3.0",
|
|
63
63
|
"zod": "^4.1.13"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|