@cyberskill/shared 2.28.0 → 3.0.0

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 (91) hide show
  1. package/dist/config/config.util.cjs +1 -1
  2. package/dist/config/config.util.js +24 -33
  3. package/dist/config/eslint/index.cjs +1 -1
  4. package/dist/config/eslint/index.d.ts +4 -0
  5. package/dist/config/eslint/index.js +4 -12
  6. package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -1
  7. package/dist/config/graphql-codegen/graphql-codegen.util.js +28 -33
  8. package/dist/config/storybook/storybook.preview.cjs +1 -1
  9. package/dist/config/storybook/storybook.preview.js +10 -13
  10. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  11. package/dist/config/vitest/vitest.e2e.js +1 -1
  12. package/dist/config/vitest/vitest.unit.cjs +1 -1
  13. package/dist/config/vitest/vitest.unit.js +19 -8
  14. package/dist/constant/common.cjs +1 -1
  15. package/dist/constant/common.js +1 -1
  16. package/dist/node/apollo-server/apollo-server.util.cjs +1 -1
  17. package/dist/node/apollo-server/apollo-server.util.js +21 -48
  18. package/dist/node/cli/index.cjs +2 -2
  19. package/dist/node/cli/index.js +109 -165
  20. package/dist/node/command/command.util.cjs +2 -2
  21. package/dist/node/command/command.util.js +135 -170
  22. package/dist/node/express/express.util.cjs +1 -1
  23. package/dist/node/express/express.util.js +39 -72
  24. package/dist/node/fs/fs.util.cjs +3 -3
  25. package/dist/node/fs/fs.util.js +45 -60
  26. package/dist/node/log/log.util.cjs +1 -1
  27. package/dist/node/log/log.util.js +29 -30
  28. package/dist/node/mongo/mongo.controller.cjs +1 -1
  29. package/dist/node/mongo/mongo.controller.js +531 -629
  30. package/dist/node/mongo/mongo.util.cjs +2 -2
  31. package/dist/node/mongo/mongo.util.js +280 -321
  32. package/dist/node/package/package.util.cjs +1 -1
  33. package/dist/node/package/package.util.js +197 -226
  34. package/dist/node/path/index.cjs +1 -1
  35. package/dist/node/path/index.js +26 -25
  36. package/dist/node/path/path.constant.cjs +1 -1
  37. package/dist/node/path/path.constant.d.ts +2 -0
  38. package/dist/node/path/path.constant.js +130 -150
  39. package/dist/node/storage/storage.util.cjs +1 -1
  40. package/dist/node/storage/storage.util.js +110 -158
  41. package/dist/node/upload/upload.util.cjs +1 -1
  42. package/dist/node/upload/upload.util.js +119 -150
  43. package/dist/node/ws/ts.util.cjs +1 -1
  44. package/dist/node/ws/ts.util.js +31 -54
  45. package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
  46. package/dist/react/apollo-client/apollo-client.component.js +4 -4
  47. package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
  48. package/dist/react/apollo-client/apollo-client.util.js +51 -58
  49. package/dist/react/apollo-client/links/upload.cjs +1 -1
  50. package/dist/react/apollo-client/links/upload.js +71 -74
  51. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -1
  52. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -18
  53. package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
  54. package/dist/react/apollo-error/apollo-error.component.js +61 -23
  55. package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -1
  56. package/dist/react/apollo-error/apollo-error.module.scss.js +6 -6
  57. package/dist/react/apollo-error/apollo-error.test.unit.d.ts +1 -0
  58. package/dist/react/apollo-error/apollo-error.util.cjs +1 -1
  59. package/dist/react/apollo-error/apollo-error.util.js +6 -6
  60. package/dist/react/loading/loading.component.cjs +2 -2
  61. package/dist/react/loading/loading.component.js +30 -46
  62. package/dist/react/log/log.util.cjs +1 -1
  63. package/dist/react/log/log.util.js +4 -4
  64. package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
  65. package/dist/react/next-intl/next-intl.hoc.js +13 -22
  66. package/dist/react/next-intl/next-intl.provider.cjs +1 -1
  67. package/dist/react/next-intl/next-intl.provider.js +7 -7
  68. package/dist/react/storage/storage.hook.cjs +1 -1
  69. package/dist/react/storage/storage.hook.js +43 -59
  70. package/dist/react/storage/storage.util.cjs +1 -1
  71. package/dist/react/storage/storage.util.js +28 -53
  72. package/dist/react/userback/userback.component.cjs +1 -1
  73. package/dist/react/userback/userback.component.js +18 -42
  74. package/dist/style.css +1 -1
  75. package/dist/util/common/common.util.cjs +1 -1
  76. package/dist/util/common/common.util.d.ts +2 -0
  77. package/dist/util/common/common.util.js +29 -37
  78. package/dist/util/index.cjs +1 -1
  79. package/dist/util/index.js +10 -9
  80. package/dist/util/object/object.util.cjs +1 -1
  81. package/dist/util/object/object.util.js +72 -76
  82. package/dist/util/string/index.cjs +1 -1
  83. package/dist/util/string/index.js +4 -3
  84. package/dist/util/string/string.util.cjs +1 -1
  85. package/dist/util/string/string.util.d.ts +12 -0
  86. package/dist/util/string/string.util.js +63 -44
  87. package/package.json +25 -16
  88. package/public/tsconfig.base.json +7 -3
  89. package/README.md +0 -470
  90. /package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
  91. /package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
@@ -1,22 +1,6 @@
1
- import l from "localforage";
2
- import { catchError as u } from "../log/log.util.js";
3
- var o = (r, e, n) => new Promise((s, i) => {
4
- var y = (t) => {
5
- try {
6
- c(n.next(t));
7
- } catch (a) {
8
- i(a);
9
- }
10
- }, h = (t) => {
11
- try {
12
- c(n.throw(t));
13
- } catch (a) {
14
- i(a);
15
- }
16
- }, c = (t) => t.done ? s(t.value) : Promise.resolve(t.value).then(y, h);
17
- c((n = n.apply(r, e)).next());
18
- });
19
- const f = {
1
+ import e from "localforage";
2
+ import { catchError as a } from "../log/log.util.js";
3
+ const s = {
20
4
  /**
21
5
  * Retrieves a value from browser storage by key.
22
6
  * This method fetches data that was previously stored using the set method.
@@ -25,14 +9,12 @@ const f = {
25
9
  * @param key - The unique identifier for the stored value.
26
10
  * @returns A promise that resolves to the stored value or null if not found.
27
11
  */
28
- get(r) {
29
- return o(this, null, function* () {
30
- try {
31
- return yield l.getItem(r);
32
- } catch (e) {
33
- return u(e, { returnValue: null });
34
- }
35
- });
12
+ async get(r) {
13
+ try {
14
+ return await e.getItem(r);
15
+ } catch (t) {
16
+ return a(t, { returnValue: null });
17
+ }
36
18
  },
37
19
  /**
38
20
  * Stores a value in browser storage with a unique key.
@@ -44,14 +26,12 @@ const f = {
44
26
  * @param value - The data to store (will be automatically handled by localForage).
45
27
  * @returns A promise that resolves when the storage operation is complete.
46
28
  */
47
- set(r, e) {
48
- return o(this, null, function* () {
49
- try {
50
- yield l.setItem(r, e);
51
- } catch (n) {
52
- u(n);
53
- }
54
- });
29
+ async set(r, t) {
30
+ try {
31
+ await e.setItem(r, t);
32
+ } catch (c) {
33
+ a(c);
34
+ }
55
35
  },
56
36
  /**
57
37
  * Removes a value from browser storage by key.
@@ -61,14 +41,12 @@ const f = {
61
41
  * @param key - The unique identifier of the value to remove.
62
42
  * @returns A promise that resolves when the removal operation is complete.
63
43
  */
64
- remove(r) {
65
- return o(this, null, function* () {
66
- try {
67
- yield l.removeItem(r);
68
- } catch (e) {
69
- u(e);
70
- }
71
- });
44
+ async remove(r) {
45
+ try {
46
+ await e.removeItem(r);
47
+ } catch (t) {
48
+ a(t);
49
+ }
72
50
  },
73
51
  /**
74
52
  * Retrieves all storage keys.
@@ -77,17 +55,14 @@ const f = {
77
55
  *
78
56
  * @returns A promise that resolves to an array of storage keys.
79
57
  */
80
- keys() {
81
- return o(this, null, function* () {
82
- try {
83
- const r = yield l.keys();
84
- return r != null ? r : [];
85
- } catch (r) {
86
- return u(r, { returnValue: [] });
87
- }
88
- });
58
+ async keys() {
59
+ try {
60
+ return await e.keys() ?? [];
61
+ } catch (r) {
62
+ return a(r, { returnValue: [] });
63
+ }
89
64
  }
90
65
  };
91
66
  export {
92
- f as storage
67
+ s as storage
93
68
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@userback/widget"),v=require("react");var s=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,y=(e,a)=>{var r={};for(var t in e)b.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&s)for(var t of s(e))a.indexOf(t)<0&&d.call(e,t)&&(r[t]=e[t]);return r},h=(e,a,r)=>new Promise((t,c)=>{var n=l=>{try{o(r.next(l))}catch(u){c(u)}},i=l=>{try{o(r.throw(l))}catch(u){c(u)}},o=l=>l.done?t(l.value):Promise.resolve(l.value).then(n,i);o((r=r.apply(e,a)).next())});function m({token:e,options:a}){return v.useEffect(()=>{if(!e)return;let r;return h(null,null,function*(){const c=a||{},{hide:n}=c,i=y(c,["hide"]);yield f(e,i),n&&n.length>0&&n.forEach(o=>{document.querySelectorAll(o).forEach(l=>l.remove())}),r=new MutationObserver(()=>{n&&n.length>0&&n.forEach(o=>{document.querySelectorAll(o).forEach(l=>l.remove())})}),r.observe(document.body,{childList:!0,subtree:!0})}),()=>{r==null||r.disconnect()}},[e,a]),null}exports.Userback=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@userback/widget"),s=require("react");function l({token:r,options:u}){return s.useEffect(()=>{if(!r)return;let t;return(async()=>{const{hide:e,...a}=u||{};await n(r,a),e&&e.length>0&&e.forEach(c=>{document.querySelectorAll(c).forEach(o=>o.remove())}),t=new MutationObserver(()=>{e&&e.length>0&&e.forEach(c=>{document.querySelectorAll(c).forEach(o=>o.remove())})}),t.observe(document.body,{childList:!0,subtree:!0})})(),()=>{t?.disconnect()}},[r,u]),null}exports.Userback=l;
@@ -1,51 +1,27 @@
1
- import v from "@userback/widget";
2
- import { useEffect as s } from "react";
3
- var u = Object.getOwnPropertySymbols, d = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable, h = (e, o) => {
4
- var r = {};
5
- for (var t in e)
6
- d.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
7
- if (e != null && u)
8
- for (var t of u(e))
9
- o.indexOf(t) < 0 && b.call(e, t) && (r[t] = e[t]);
10
- return r;
11
- }, m = (e, o, r) => new Promise((t, c) => {
12
- var n = (l) => {
13
- try {
14
- a(r.next(l));
15
- } catch (f) {
16
- c(f);
17
- }
18
- }, i = (l) => {
19
- try {
20
- a(r.throw(l));
21
- } catch (f) {
22
- c(f);
23
- }
24
- }, a = (l) => l.done ? t(l.value) : Promise.resolve(l.value).then(n, i);
25
- a((r = r.apply(e, o)).next());
26
- });
27
- function _({ token: e, options: o }) {
28
- return s(() => {
29
- if (!e)
1
+ import a from "@userback/widget";
2
+ import { useEffect as l } from "react";
3
+ function d({ token: r, options: n }) {
4
+ return l(() => {
5
+ if (!r)
30
6
  return;
31
- let r;
32
- return m(null, null, function* () {
33
- const c = o || {}, { hide: n } = c, i = h(c, ["hide"]);
34
- yield v(e, i), n && n.length > 0 && n.forEach((a) => {
35
- document.querySelectorAll(a).forEach((l) => l.remove());
36
- }), r = new MutationObserver(() => {
37
- n && n.length > 0 && n.forEach((a) => {
38
- document.querySelectorAll(a).forEach((l) => l.remove());
7
+ let t;
8
+ return (async () => {
9
+ const { hide: e, ...u } = n || {};
10
+ await a(r, u), e && e.length > 0 && e.forEach((o) => {
11
+ document.querySelectorAll(o).forEach((c) => c.remove());
12
+ }), t = new MutationObserver(() => {
13
+ e && e.length > 0 && e.forEach((o) => {
14
+ document.querySelectorAll(o).forEach((c) => c.remove());
39
15
  });
40
- }), r.observe(document.body, {
16
+ }), t.observe(document.body, {
41
17
  childList: !0,
42
18
  subtree: !0
43
19
  });
44
- }), () => {
45
- r == null || r.disconnect();
20
+ })(), () => {
21
+ t?.disconnect();
46
22
  };
47
- }, [e, o]), null;
23
+ }, [r, n]), null;
48
24
  }
49
25
  export {
50
- _ as Userback
26
+ d as Userback
51
27
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- ._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_b1d9o_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._full_b1d9o_1,._block_b1d9o_2{pointer-events:none}._full_b1d9o_1{position:fixed;inset:0}._block_b1d9o_2{position:absolute;width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%);background:#ffffff1a;backdrop-filter:blur(4px)}._container_b1d9o_40{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_b1d9o_40 ._ring_b1d9o_50{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._message_b1d9o_74{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_b1d9o_1 2s ease-in-out infinite alternate;word-break:break-word;hyphens:auto}@keyframes _rotate1_b1d9o_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_b1d9o_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_b1d9o_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_b1d9o_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_b1d9o_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_b1d9o_1{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){._ring_b1d9o_50,._message_b1d9o_74,._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{animation:none!important}}._modal-backdrop_1i2kc_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._btn-close_1i2kc_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._btn-close_1i2kc_22:hover{color:#f87171}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-title_1i2kc_36{font-weight:700;margin-bottom:1rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-title_1i2kc_36 ._btn-retry_1i2kc_40{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-title_1i2kc_36 ._btn-retry_1i2kc_40:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre._main_1i2kc_71{color:#fca5a5}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre._network_1i2kc_74{color:#fde68a}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre._extra_1i2kc_77{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 ul{padding-left:1rem;color:#fda4af;list-style:disc}._error-container_oofeh_1{display:flex;align-items:center;justify-content:center;gap:.5rem}._error-details-button_oofeh_8{display:inline-flex;align-items:center;justify-content:center;padding:.5rem 1rem;background-color:#ef4444;color:#fff;border:2px solid #dc2626;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease-in-out}._error-details-button_oofeh_8:hover{background-color:#dc2626;border-color:#b91c1c;transform:translateY(-1px);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._error-details-button_oofeh_8:active{transform:translateY(0);box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}._error-details-button_oofeh_8:focus{outline:none;ring:2px;ring-color:#fca5a5;ring-offset:2px}
1
+ ._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_b1d9o_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._full_b1d9o_1,._block_b1d9o_2{pointer-events:none}._full_b1d9o_1{position:fixed;inset:0}._block_b1d9o_2{position:absolute;width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%);background:#ffffff1a;backdrop-filter:blur(4px)}._container_b1d9o_40{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_b1d9o_40 ._ring_b1d9o_50{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._message_b1d9o_74{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_b1d9o_1 2s ease-in-out infinite alternate;word-break:break-word;hyphens:auto}@keyframes _rotate1_b1d9o_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_b1d9o_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_b1d9o_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_b1d9o_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_b1d9o_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_b1d9o_1{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){._ring_b1d9o_50,._message_b1d9o_74,._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{animation:none!important}}._modal-backdrop_199u4_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_199u4_1 ._modal-content_199u4_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._btn-close_199u4_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._btn-close_199u4_22:hover{color:#f87171}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._btn-close_199u4_22:focus-visible{outline:none;box-shadow:0 0 0 2px #f87171;border-radius:.125rem}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-title_199u4_41{font-weight:700;margin-bottom:1rem}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-title_199u4_41 ._btn-retry_199u4_45{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-title_199u4_41 ._btn-retry_199u4_45:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-title_199u4_41 ._btn-retry_199u4_45:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-details_199u4_62{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-details_199u4_62 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-details_199u4_62 pre._main_199u4_80{color:#fca5a5}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-details_199u4_62 pre._network_199u4_83{color:#fde68a}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-details_199u4_62 pre._extra_199u4_86{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_199u4_1 ._modal-content_199u4_11 ._error-details_199u4_62 ul{padding-left:1rem;color:#fda4af;list-style:disc}._error-container_oofeh_1{display:flex;align-items:center;justify-content:center;gap:.5rem}._error-details-button_oofeh_8{display:inline-flex;align-items:center;justify-content:center;padding:.5rem 1rem;background-color:#ef4444;color:#fff;border:2px solid #dc2626;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease-in-out}._error-details-button_oofeh_8:hover{background-color:#dc2626;border-color:#b91c1c;transform:translateY(-1px);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._error-details-button_oofeh_8:active{transform:translateY(0);box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}._error-details-button_oofeh_8:focus{outline:none;ring:2px;ring-color:#fca5a5;ring-offset:2px}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../typescript/common.type.cjs");var O=Object.defineProperty,a=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(e,n,r)=>n in e?O(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,p=(e,n)=>{for(var r in n||(n={}))f.call(n,r)&&i(e,r,n[r]);if(a)for(var r of a(n))l.call(n,r)&&i(e,r,n[r]);return e};const s={a:["à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["è","é","ẹ","ẻ","ẽ","ê","ề","ế","ệ","ể","ễ"],i:["ì","í","ị","ỉ","ĩ"],o:["ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","ý","ỵ","ỷ","ỹ"],d:["đ"]},v=Object.entries(s).reduce((e,[n,r])=>(e[n.toUpperCase()]=r.map(o=>o.toUpperCase()),e),{}),g=p(p({},s),v),u=new Map,m=new Set;Object.entries(g).forEach(([e,n])=>{const r=`(${[e,...n].join("|")})`;[e,...n].forEach(o=>{u.set(o,r),m.add(o)})});const D=Array.from(m).join(""),N=new RegExp(`[${D}]`,"g");function _(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P(e){return e=_(e),e=e.normalize("NFD"),e.replace(N,n=>u.get(n)||n)}function M(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}function d(e,n){if(!n)return Array.from(new Set(e));const r=new Set,o=[];for(const c of e){const E=n(c);r.has(E)||(r.add(E),o.push(c))}return o}function S(e){const{NODE_ENV:n=t.E_Environment.DEVELOPMENT,NODE_ENV_MODE:r=t.E_Environment.DEVELOPMENT}=e,o=n===t.E_Environment.DEVELOPMENT&&r===t.E_Environment.DEVELOPMENT,c=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.STAGING,E=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.PRODUCTION;if(n===t.E_Environment.PRODUCTION&&r===t.E_Environment.DEVELOPMENT)throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");return{IS_DEV:o,IS_STAG:c,IS_PROD:E}}exports.escapeRegExp=_;exports.mapEnvironment=S;exports.regexSearchMapper=P;exports.removeAccent=M;exports.uniqueArray=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../typescript/common.type.cjs"),i={a:["à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["è","é","ẹ","ẻ","ẽ","ê","ề","ế","ệ","ể","ễ"],i:["ì","í","ị","ỉ","ĩ"],o:["ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","ý","ỵ","ỷ","ỹ"],d:["đ"]},u=Object.entries(i).reduce((e,[n,r])=>(e[n.toUpperCase()]=r.map(o=>o.toUpperCase()),e),{}),m={...i,...u},a=new Map,p=new Set;Object.entries(m).forEach(([e,n])=>{const r=`(${[e,...n].join("|")})`;[e,...n].forEach(o=>{a.set(o,r),p.add(o)})});const O=Array.from(p).join(""),_=new RegExp(`[${O}]`,"g");function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function D(e){return e=s(e),e.replace(_,n=>a.get(n)||n)}function N(e){return e.normalize("NFD").replace(/\p{Diacritic}/gu,"")}function M(e,n){if(!n)return Array.from(new Set(e));const r=new Set,o=[];for(const E of e){const c=n(E);r.has(c)||(r.add(c),o.push(E))}return o}function f(e){const{NODE_ENV:n=t.E_Environment.DEVELOPMENT,NODE_ENV_MODE:r=t.E_Environment.DEVELOPMENT}=e,o=n===t.E_Environment.DEVELOPMENT&&r===t.E_Environment.DEVELOPMENT,E=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.STAGING,c=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.PRODUCTION;if(n===t.E_Environment.PRODUCTION&&r===t.E_Environment.DEVELOPMENT)throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");return{IS_DEV:o,IS_STAG:E,IS_PROD:c}}exports.escapeRegExp=s;exports.mapEnvironment=f;exports.regexSearchMapper=D;exports.removeAccent=N;exports.uniqueArray=M;
@@ -15,6 +15,8 @@ export declare function escapeRegExp(str: string): string;
15
15
  *
16
16
  * Optimization: Uses pre-computed regex and map to perform replacement in a single pass (O(N)),
17
17
  * instead of iterating through all character groups (O(K*N)).
18
+ * Removed unnecessary NFD normalization which improves performance and fixes
19
+ * matching against NFC target strings.
18
20
  *
19
21
  * @param str - The string to convert to a regex pattern.
20
22
  * @returns The regex pattern as a string that matches the original string and its accented variations.
@@ -1,13 +1,5 @@
1
- import { E_Environment as t } from "../../typescript/common.type.js";
2
- var f = Object.defineProperty, p = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable, i = (e, r, n) => r in e ? f(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, E = (e, r) => {
3
- for (var n in r || (r = {}))
4
- m.call(r, n) && i(e, n, r[n]);
5
- if (p)
6
- for (var n of p(r))
7
- _.call(r, n) && i(e, n, r[n]);
8
- return e;
9
- };
10
- const s = {
1
+ import { E_Environment as r } from "../../typescript/common.type.js";
2
+ const p = {
11
3
  a: ["à", "á", "ạ", "ả", "ã", "â", "ầ", "ấ", "ậ", "ẩ", "ẫ", "ă", "ằ", "ắ", "ặ", "ẳ", "ẵ"],
12
4
  e: ["è", "é", "ẹ", "ẻ", "ẽ", "ê", "ề", "ế", "ệ", "ể", "ễ"],
13
5
  i: ["ì", "í", "ị", "ỉ", "ĩ"],
@@ -15,46 +7,46 @@ const s = {
15
7
  u: ["ù", "ú", "ụ", "ủ", "ũ", "ư", "ừ", "ứ", "ự", "ử", "ữ"],
16
8
  y: ["ỳ", "ý", "ỵ", "ỷ", "ỹ"],
17
9
  d: ["đ"]
18
- }, l = Object.entries(s).reduce(
19
- (e, [r, n]) => (e[r.toUpperCase()] = n.map((o) => o.toUpperCase()), e),
10
+ }, s = Object.entries(p).reduce(
11
+ (e, [n, t]) => (e[n.toUpperCase()] = t.map((o) => o.toUpperCase()), e),
20
12
  {}
21
- ), D = E(E({}, s), l), u = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Set();
22
- Object.entries(D).forEach(([e, r]) => {
23
- const n = `(${[e, ...r].join("|")})`;
24
- [e, ...r].forEach((o) => {
25
- u.set(o, n), O.add(o);
13
+ ), u = { ...p, ...s }, a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
14
+ Object.entries(u).forEach(([e, n]) => {
15
+ const t = `(${[e, ...n].join("|")})`;
16
+ [e, ...n].forEach((o) => {
17
+ a.set(o, t), i.add(o);
26
18
  });
27
19
  });
28
- const N = Array.from(O).join(""), P = new RegExp(`[${N}]`, "g");
29
- function g(e) {
20
+ const O = Array.from(i).join(""), D = new RegExp(`[${O}]`, "g");
21
+ function N(e) {
30
22
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
31
23
  }
32
- function d(e) {
33
- return e = g(e), e = e.normalize("NFD"), e.replace(P, (r) => u.get(r) || r);
24
+ function m(e) {
25
+ return e = N(e), e.replace(D, (n) => a.get(n) || n);
34
26
  }
35
- function w(e) {
36
- return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
27
+ function M(e) {
28
+ return e.normalize("NFD").replace(/\p{Diacritic}/gu, "");
37
29
  }
38
- function S(e, r) {
39
- if (!r)
30
+ function T(e, n) {
31
+ if (!n)
40
32
  return Array.from(new Set(e));
41
- const n = /* @__PURE__ */ new Set(), o = [];
33
+ const t = /* @__PURE__ */ new Set(), o = [];
42
34
  for (const c of e) {
43
- const a = r(c);
44
- n.has(a) || (n.add(a), o.push(c));
35
+ const E = n(c);
36
+ t.has(E) || (t.add(E), o.push(c));
45
37
  }
46
38
  return o;
47
39
  }
48
- function T(e) {
49
- const { NODE_ENV: r = t.DEVELOPMENT, NODE_ENV_MODE: n = t.DEVELOPMENT } = e, o = r === t.DEVELOPMENT && n === t.DEVELOPMENT, c = r === t.PRODUCTION && n === t.STAGING, a = r === t.PRODUCTION && n === t.PRODUCTION;
50
- if (r === t.PRODUCTION && n === t.DEVELOPMENT)
40
+ function g(e) {
41
+ const { NODE_ENV: n = r.DEVELOPMENT, NODE_ENV_MODE: t = r.DEVELOPMENT } = e, o = n === r.DEVELOPMENT && t === r.DEVELOPMENT, c = n === r.PRODUCTION && t === r.STAGING, E = n === r.PRODUCTION && t === r.PRODUCTION;
42
+ if (n === r.PRODUCTION && t === r.DEVELOPMENT)
51
43
  throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");
52
- return { IS_DEV: o, IS_STAG: c, IS_PROD: a };
44
+ return { IS_DEV: o, IS_STAG: c, IS_PROD: E };
53
45
  }
54
46
  export {
55
- g as escapeRegExp,
56
- T as mapEnvironment,
57
- d as regexSearchMapper,
58
- w as removeAccent,
59
- S as uniqueArray
47
+ N as escapeRegExp,
48
+ g as mapEnvironment,
49
+ m as regexSearchMapper,
50
+ M as removeAccent,
51
+ T as uniqueArray
60
52
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./object/object.util.cjs"),r=require("./common/common.util.cjs"),t=require("./string/string.util.cjs"),a=require("./serializer/serializer.util.cjs"),i=require("./validate/validate.util.cjs");exports.deepClone=e.deepClone;exports.deepMerge=e.deepMerge;exports.getNestedValue=e.getNestedValue;exports.isJSON=e.isJSON;exports.normalizeMongoFilter=e.normalizeMongoFilter;exports.setNestedValue=e.setNestedValue;exports.escapeRegExp=r.escapeRegExp;exports.mapEnvironment=r.mapEnvironment;exports.regexSearchMapper=r.regexSearchMapper;exports.removeAccent=r.removeAccent;exports.uniqueArray=r.uniqueArray;exports.generateRandomPassword=t.generateRandomPassword;exports.generateShortId=t.generateShortId;exports.generateSlug=t.generateSlug;exports.getFileName=t.getFileName;exports.substringBetween=t.substringBetween;exports.serializer=a.serializer;exports.validate=i.validate;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./object/object.util.cjs"),t=require("./common/common.util.cjs"),r=require("./string/string.util.cjs"),a=require("./serializer/serializer.util.cjs"),i=require("./validate/validate.util.cjs");exports.deepClone=e.deepClone;exports.deepMerge=e.deepMerge;exports.getNestedValue=e.getNestedValue;exports.isJSON=e.isJSON;exports.normalizeMongoFilter=e.normalizeMongoFilter;exports.setNestedValue=e.setNestedValue;exports.escapeRegExp=t.escapeRegExp;exports.mapEnvironment=t.mapEnvironment;exports.regexSearchMapper=t.regexSearchMapper;exports.removeAccent=t.removeAccent;exports.uniqueArray=t.uniqueArray;exports.generateRandomPassword=r.generateRandomPassword;exports.generateRandomString=r.generateRandomString;exports.generateShortId=r.generateShortId;exports.generateSlug=r.generateSlug;exports.getFileName=r.getFileName;exports.substringBetween=r.substringBetween;exports.serializer=a.serializer;exports.validate=i.validate;
@@ -1,6 +1,6 @@
1
- import { deepClone as t, deepMerge as o, getNestedValue as a, isJSON as n, normalizeMongoFilter as p, setNestedValue as g } from "./object/object.util.js";
2
- import { escapeRegExp as i, mapEnvironment as s, regexSearchMapper as l, removeAccent as d, uniqueArray as x } from "./common/common.util.js";
3
- import { generateRandomPassword as f, generateShortId as c, generateSlug as N, getFileName as S, substringBetween as v } from "./string/string.util.js";
1
+ import { deepClone as t, deepMerge as o, getNestedValue as a, isJSON as n, normalizeMongoFilter as g, setNestedValue as m } from "./object/object.util.js";
2
+ import { escapeRegExp as i, mapEnvironment as s, regexSearchMapper as d, removeAccent as l, uniqueArray as x } from "./common/common.util.js";
3
+ import { generateRandomPassword as f, generateRandomString as S, generateShortId as c, generateSlug as N, getFileName as v, substringBetween as M } from "./string/string.util.js";
4
4
  import { serializer as h } from "./serializer/serializer.util.js";
5
5
  import { validate as z } from "./validate/validate.util.js";
6
6
  export {
@@ -8,18 +8,19 @@ export {
8
8
  o as deepMerge,
9
9
  i as escapeRegExp,
10
10
  f as generateRandomPassword,
11
+ S as generateRandomString,
11
12
  c as generateShortId,
12
13
  N as generateSlug,
13
- S as getFileName,
14
+ v as getFileName,
14
15
  a as getNestedValue,
15
16
  n as isJSON,
16
17
  s as mapEnvironment,
17
- p as normalizeMongoFilter,
18
- l as regexSearchMapper,
19
- d as removeAccent,
18
+ g as normalizeMongoFilter,
19
+ d as regexSearchMapper,
20
+ l as removeAccent,
20
21
  h as serializer,
21
- g as setNestedValue,
22
- v as substringBetween,
22
+ m as setNestedValue,
23
+ M as substringBetween,
23
24
  x as uniqueArray,
24
25
  z as validate
25
26
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var m=Object.defineProperty,A=Object.defineProperties,v=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,y=(e,r,n)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,p=(e,r)=>{for(var n in r||(r={}))w.call(r,n)&&y(e,n,r[n]);if(f)for(var n of f(r))h.call(r,n)&&y(e,n,r[n]);return e},O=(e,r)=>A(e,v(r));function P(e){try{return JSON.parse(e),!0}catch(r){return!1}}function _(e,r){let n=e;const o=r.length;for(let t=0;t<o;t++){const s=r[t];if(s!==void 0&&n&&typeof n=="object"&&s in n)n=n[s];else return}return n}function g(e,r,n,o){if(o>=r.length)return e;const t=r[o];if(o===r.length-1)return O(p({},e),{[t]:n});const s=e[t];return O(p({},e),{[t]:g(typeof s=="object"&&s!==null?s:{},r,n,o+1)})}function b(e,r,n){return r.length===0?e:g(e,r,n,0)}function u(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(o=>u(o));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);const r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)return e;const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=u(e[o]));return n}function d(...e){if(e.length===0)return{};const r=e.filter(t=>t!=null);if(r.length===0)return{};if(r.length===1)return r[0];if(r.every(Array.isArray))return[].concat(...r);if(r.every(t=>typeof t=="object"&&t!==null&&!Array.isArray(t))){const t={};for(const s of r){const l=s;for(const a in l)if(Object.prototype.hasOwnProperty.call(l,a)){const i=l[a];if(Object.prototype.hasOwnProperty.call(t,a)){const c=t[a];typeof i=="object"&&i!==null&&typeof c=="object"&&c!==null?Array.isArray(i)&&Array.isArray(c)?t[a]=c.concat(i):!Array.isArray(i)&&!Array.isArray(c)?t[a]=d(c,i):t[a]=i:t[a]=i}else t[a]=i}}return t}if(r.every(t=>typeof t!="object"||t===null))throw new Error("deepMerge: Cannot merge primitive values. All arguments must be objects or arrays.");const n=r.some(Array.isArray),o=r.some(t=>typeof t=="object"&&t!==null&&!Array.isArray(t));throw n&&o?new Error("deepMerge: Cannot mix arrays and objects. All arguments must be either arrays or objects."):new Error("deepMerge: Invalid arguments provided. All arguments must be objects or arrays of the same type.")}function j(e){if(!e||typeof e!="object")return e;const r={};function n(o,t){for(const s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;const l=o[s],a=t?`${t}.${s}`:s;if(l&&typeof l=="object"&&!Array.isArray(l)){let i=!1;for(const c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&c.startsWith("$")){i=!0;break}i?r[a]=l:n(l,a)}else r[a]=l}}return n(e,""),r}exports.deepClone=u;exports.deepMerge=d;exports.getNestedValue=_;exports.isJSON=P;exports.normalizeMongoFilter=j;exports.setNestedValue=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(e){try{return JSON.parse(e),!0}catch{return!1}}function g(e,t){let n=e;const o=t.length;for(let r=0;r<o;r++){if(n==null||typeof n!="object")return;const s=t[r];if(s!==void 0&&s in n)n=n[s];else return}return n}function y(e,t,n,o){if(o>=t.length)return e;const r=t[o];if(o===t.length-1)return{...e,[r]:n};const s=e[r];return{...e,[r]:y(typeof s=="object"&&s!==null?s:{},t,n,o+1)}}function A(e,t,n){return t.length===0?e:y(e,t,n,0)}function u(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(o=>u(o));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);const t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=u(e[o]));return n}function f(...e){if(e.length===0)return{};const t=e.filter(r=>r!=null);if(t.length===0)return{};if(t.length===1)return t[0];if(t.every(Array.isArray))return[].concat(...t);if(t.every(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))){const r={};for(const s of t){const i=s;for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l)){const a=i[l];if(Object.prototype.hasOwnProperty.call(r,l)){const c=r[l];typeof a=="object"&&a!==null&&typeof c=="object"&&c!==null?Array.isArray(a)&&Array.isArray(c)?r[l]=c.concat(a):!Array.isArray(a)&&!Array.isArray(c)?r[l]=f(c,a):r[l]=a:r[l]=a}else r[l]=a}}return r}if(t.every(r=>typeof r!="object"||r===null))throw new Error("deepMerge: Cannot merge primitive values. All arguments must be objects or arrays.");const n=t.some(Array.isArray),o=t.some(r=>typeof r=="object"&&r!==null&&!Array.isArray(r));throw n&&o?new Error("deepMerge: Cannot mix arrays and objects. All arguments must be either arrays or objects."):new Error("deepMerge: Invalid arguments provided. All arguments must be objects or arrays of the same type.")}function d(e){if(!e||typeof e!="object")return e;const t={};function n(o,r){for(const s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;const i=o[s],l=r?`${r}.${s}`:s;if(i&&typeof i=="object"&&!Array.isArray(i)){let a=!1;for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)&&c.startsWith("$")){a=!0;break}a?t[l]=i:n(i,l)}else t[l]=i}}return n(e,""),t}exports.deepClone=u;exports.deepMerge=f;exports.getNestedValue=g;exports.isJSON=p;exports.normalizeMongoFilter=d;exports.setNestedValue=A;
@@ -1,103 +1,99 @@
1
- var A = Object.defineProperty, m = Object.defineProperties, d = Object.getOwnPropertyDescriptors, f = Object.getOwnPropertySymbols, v = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable, u = (e, r, n) => r in e ? A(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, y = (e, r) => {
2
- for (var n in r || (r = {}))
3
- v.call(r, n) && u(e, n, r[n]);
4
- if (f)
5
- for (var n of f(r))
6
- w.call(r, n) && u(e, n, r[n]);
7
- return e;
8
- }, p = (e, r) => m(e, d(r));
9
- function P(e) {
1
+ function p(e) {
10
2
  try {
11
3
  return JSON.parse(e), !0;
12
- } catch (r) {
4
+ } catch {
13
5
  return !1;
14
6
  }
15
7
  }
16
- function _(e, r) {
8
+ function A(e, t) {
17
9
  let n = e;
18
- const o = r.length;
19
- for (let t = 0; t < o; t++) {
20
- const s = r[t];
21
- if (s !== void 0 && n && typeof n == "object" && s in n)
10
+ const o = t.length;
11
+ for (let r = 0; r < o; r++) {
12
+ if (n == null || typeof n != "object")
13
+ return;
14
+ const s = t[r];
15
+ if (s !== void 0 && s in n)
22
16
  n = n[s];
23
17
  else
24
18
  return;
25
19
  }
26
20
  return n;
27
21
  }
28
- function g(e, r, n, o) {
29
- if (o >= r.length)
22
+ function f(e, t, n, o) {
23
+ if (o >= t.length)
30
24
  return e;
31
- const t = r[o];
32
- if (o === r.length - 1)
33
- return p(y({}, e), {
34
- [t]: n
35
- });
36
- const s = e[t];
37
- return p(y({}, e), {
38
- [t]: g(
25
+ const r = t[o];
26
+ if (o === t.length - 1)
27
+ return {
28
+ ...e,
29
+ [r]: n
30
+ };
31
+ const s = e[r];
32
+ return {
33
+ ...e,
34
+ [r]: f(
39
35
  typeof s == "object" && s !== null ? s : {},
40
- r,
36
+ t,
41
37
  n,
42
38
  o + 1
43
39
  )
44
- });
40
+ };
45
41
  }
46
- function b(e, r, n) {
47
- return r.length === 0 ? e : g(e, r, n, 0);
42
+ function g(e, t, n) {
43
+ return t.length === 0 ? e : f(e, t, n, 0);
48
44
  }
49
- function O(e) {
45
+ function u(e) {
50
46
  if (e === null || typeof e != "object")
51
47
  return e;
52
48
  if (Array.isArray(e))
53
- return e.map((o) => O(o));
49
+ return e.map((o) => u(o));
54
50
  if (e instanceof Date)
55
51
  return new Date(e.getTime());
56
52
  if (e instanceof RegExp)
57
53
  return new RegExp(e.source, e.flags);
58
- const r = Object.getPrototypeOf(e);
59
- if (r !== Object.prototype && r !== null)
54
+ const t = Object.getPrototypeOf(e);
55
+ if (t !== Object.prototype && t !== null)
60
56
  return e;
61
57
  const n = {};
62
58
  for (const o in e)
63
- Object.prototype.hasOwnProperty.call(e, o) && (n[o] = O(e[o]));
59
+ Object.prototype.hasOwnProperty.call(e, o) && (n[o] = u(e[o]));
64
60
  return n;
65
61
  }
66
- function h(...e) {
62
+ function y(...e) {
67
63
  if (e.length === 0)
68
64
  return {};
69
- const r = e.filter((t) => t != null);
70
- if (r.length === 0)
65
+ const t = e.filter((r) => r != null);
66
+ if (t.length === 0)
71
67
  return {};
72
- if (r.length === 1)
73
- return r[0];
74
- if (r.every(Array.isArray))
75
- return [].concat(...r);
76
- if (r.every((t) => typeof t == "object" && t !== null && !Array.isArray(t))) {
77
- const t = {};
78
- for (const s of r) {
79
- const l = s;
80
- for (const a in l)
81
- if (Object.prototype.hasOwnProperty.call(l, a)) {
82
- const i = l[a];
83
- if (Object.prototype.hasOwnProperty.call(t, a)) {
84
- const c = t[a];
85
- typeof i == "object" && i !== null && typeof c == "object" && c !== null ? Array.isArray(i) && Array.isArray(c) ? t[a] = c.concat(i) : !Array.isArray(i) && !Array.isArray(c) ? t[a] = h(
68
+ if (t.length === 1)
69
+ return t[0];
70
+ if (t.every(Array.isArray))
71
+ return [].concat(...t);
72
+ if (t.every((r) => typeof r == "object" && r !== null && !Array.isArray(r))) {
73
+ const r = {};
74
+ for (const s of t) {
75
+ const i = s;
76
+ for (const l in i)
77
+ if (Object.prototype.hasOwnProperty.call(i, l)) {
78
+ const a = i[l];
79
+ if (Object.prototype.hasOwnProperty.call(r, l)) {
80
+ const c = r[l];
81
+ typeof a == "object" && a !== null && typeof c == "object" && c !== null ? Array.isArray(a) && Array.isArray(c) ? r[l] = c.concat(a) : !Array.isArray(a) && !Array.isArray(c) ? r[l] = y(
86
82
  c,
87
- i
88
- ) : t[a] = i : t[a] = i;
83
+ a
84
+ ) : r[l] = a : r[l] = a;
89
85
  } else
90
- t[a] = i;
86
+ r[l] = a;
91
87
  }
92
88
  }
93
- return t;
89
+ return r;
94
90
  }
95
- if (r.every((t) => typeof t != "object" || t === null))
91
+ if (t.every((r) => typeof r != "object" || r === null))
96
92
  throw new Error(
97
93
  "deepMerge: Cannot merge primitive values. All arguments must be objects or arrays."
98
94
  );
99
- const n = r.some(Array.isArray), o = r.some(
100
- (t) => typeof t == "object" && t !== null && !Array.isArray(t)
95
+ const n = t.some(Array.isArray), o = t.some(
96
+ (r) => typeof r == "object" && r !== null && !Array.isArray(r)
101
97
  );
102
98
  throw n && o ? new Error(
103
99
  "deepMerge: Cannot mix arrays and objects. All arguments must be either arrays or objects."
@@ -105,34 +101,34 @@ function h(...e) {
105
101
  "deepMerge: Invalid arguments provided. All arguments must be objects or arrays of the same type."
106
102
  );
107
103
  }
108
- function j(e) {
104
+ function h(e) {
109
105
  if (!e || typeof e != "object")
110
106
  return e;
111
- const r = {};
112
- function n(o, t) {
107
+ const t = {};
108
+ function n(o, r) {
113
109
  for (const s in o) {
114
110
  if (!Object.prototype.hasOwnProperty.call(o, s))
115
111
  continue;
116
- const l = o[s], a = t ? `${t}.${s}` : s;
117
- if (l && typeof l == "object" && !Array.isArray(l)) {
118
- let i = !1;
119
- for (const c in l)
120
- if (Object.prototype.hasOwnProperty.call(l, c) && c.startsWith("$")) {
121
- i = !0;
112
+ const i = o[s], l = r ? `${r}.${s}` : s;
113
+ if (i && typeof i == "object" && !Array.isArray(i)) {
114
+ let a = !1;
115
+ for (const c in i)
116
+ if (Object.prototype.hasOwnProperty.call(i, c) && c.startsWith("$")) {
117
+ a = !0;
122
118
  break;
123
119
  }
124
- i ? r[a] = l : n(l, a);
120
+ a ? t[l] = i : n(i, l);
125
121
  } else
126
- r[a] = l;
122
+ t[l] = i;
127
123
  }
128
124
  }
129
- return n(e, ""), r;
125
+ return n(e, ""), t;
130
126
  }
131
127
  export {
132
- O as deepClone,
133
- h as deepMerge,
134
- _ as getNestedValue,
135
- P as isJSON,
136
- j as normalizeMongoFilter,
137
- b as setNestedValue
128
+ u as deepClone,
129
+ y as deepMerge,
130
+ A as getNestedValue,
131
+ p as isJSON,
132
+ h as normalizeMongoFilter,
133
+ g as setNestedValue
138
134
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./string.util.cjs");exports.generateRandomPassword=e.generateRandomPassword;exports.generateShortId=e.generateShortId;exports.generateSlug=e.generateSlug;exports.getFileName=e.getFileName;exports.substringBetween=e.substringBetween;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./string.util.cjs");exports.generateRandomPassword=e.generateRandomPassword;exports.generateRandomString=e.generateRandomString;exports.generateShortId=e.generateShortId;exports.generateSlug=e.generateSlug;exports.getFileName=e.getFileName;exports.substringBetween=e.substringBetween;
@@ -1,8 +1,9 @@
1
- import { generateRandomPassword as t, generateShortId as a, generateSlug as g, getFileName as n, substringBetween as o } from "./string.util.js";
1
+ import { generateRandomPassword as t, generateRandomString as n, generateShortId as a, generateSlug as g, getFileName as o, substringBetween as d } from "./string.util.js";
2
2
  export {
3
3
  t as generateRandomPassword,
4
+ n as generateRandomString,
4
5
  a as generateShortId,
5
6
  g as generateSlug,
6
- n as getFileName,
7
- o as substringBetween
7
+ o as getFileName,
8
+ d as substringBetween
8
9
  };