@cyberskill/shared 2.20.0 → 2.21.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 (43) hide show
  1. package/dist/config/storybook/storybook.main.cjs +1 -1
  2. package/dist/config/storybook/storybook.main.js +1 -1
  3. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  4. package/dist/config/vitest/vitest.e2e.js +6 -6
  5. package/dist/config/vitest/vitest.unit.cjs +1 -1
  6. package/dist/config/vitest/vitest.unit.js +5 -5
  7. package/dist/node/mongo/mongo-controller.test.unit.d.ts +1 -0
  8. package/dist/node/mongo/mongo.test.unit.d.ts +1 -0
  9. package/dist/node/mongo/mongo.util.cjs +2 -2
  10. package/dist/node/mongo/mongo.util.d.ts +9 -203
  11. package/dist/node/mongo/mongo.util.js +70 -68
  12. package/dist/node/path/path.constant.cjs +1 -1
  13. package/dist/node/path/path.constant.js +113 -109
  14. package/dist/node/path/path.test.unit.d.ts +1 -0
  15. package/dist/node/path/path.util.d.ts +2 -2
  16. package/dist/react/loading/loading.component.cjs +2 -2
  17. package/dist/react/loading/loading.component.js +32 -19
  18. package/dist/react/loading/loading.test.unit.d.ts +1 -0
  19. package/dist/react/loading/loading.type.d.ts +2 -1
  20. package/dist/util/common/common.test.unit.d.ts +1 -0
  21. package/dist/util/common/common.util.cjs +1 -1
  22. package/dist/util/common/common.util.js +14 -15
  23. package/dist/util/index.cjs +1 -1
  24. package/dist/util/index.js +16 -15
  25. package/dist/util/object/index.cjs +1 -1
  26. package/dist/util/object/index.js +4 -3
  27. package/dist/util/object/object.test.unit.d.ts +1 -0
  28. package/dist/util/object/object.util.cjs +1 -1
  29. package/dist/util/object/object.util.d.ts +10 -30
  30. package/dist/util/object/object.util.js +102 -69
  31. package/dist/util/serializer/serializer.test.unit.d.ts +1 -0
  32. package/dist/util/serializer/serializer.util.cjs +1 -1
  33. package/dist/util/serializer/serializer.util.js +19 -16
  34. package/dist/util/string/string.test.unit.d.ts +1 -0
  35. package/dist/util/string/string.util.cjs +1 -1
  36. package/dist/util/string/string.util.d.ts +4 -3
  37. package/dist/util/string/string.util.js +32 -41
  38. package/dist/util/validate/validate.test.unit.d.ts +1 -0
  39. package/dist/util/validate/validate.util.cjs +1 -1
  40. package/dist/util/validate/validate.util.js +9 -9
  41. package/package.json +37 -45
  42. /package/dist/node_modules/.pnpm/{vitest@4.0.13_@types_debug@4.1.12_@types_node@24.10.1_jiti@2.6.1_jsdom@27.2.0_sass@1.94.2_tsx@4.20.6_yaml@2.8.1 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
  43. /package/dist/node_modules/.pnpm/{vitest@4.0.13_@types_debug@4.1.12_@types_node@24.10.1_jiti@2.6.1_jsdom@27.2.0_sass@1.94.2_tsx@4.20.6_yaml@2.8.1 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
@@ -1,70 +1,70 @@
1
1
  import F from "fs-extra";
2
- import { resolveWorkingPath as s, join as g } from "./path.util.js";
2
+ import { resolveWorkingPath as s, join as y } from "./path.util.js";
3
3
  import { E_CommandType as e } from "../command/command.type.js";
4
- import { formatCommand as y, rawCommand as D } from "../command/command.util.js";
4
+ import { formatCommand as g, rawCommand as D } from "../command/command.util.js";
5
5
  import { setupPackages as b } from "../package/package.util.js";
6
- import { E_PackageType as o } from "../package/package.type.js";
7
- import { getEnv as j } from "../../config/env/env.util.js";
8
- var w = Object.defineProperty, L = Object.getOwnPropertySymbols, B = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, P = (E, c, n) => c in E ? w(E, c, { enumerable: !0, configurable: !0, writable: !0, value: n }) : E[c] = n, U = (E, c) => {
9
- for (var n in c || (c = {}))
10
- B.call(c, n) && P(E, n, c[n]);
6
+ import { E_PackageType as n } from "../package/package.type.js";
7
+ import { getEnv as w } from "../../config/env/env.util.js";
8
+ var j = Object.defineProperty, L = Object.getOwnPropertySymbols, B = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, P = (c, E, o) => E in c ? j(c, E, { enumerable: !0, configurable: !0, writable: !0, value: o }) : c[E] = o, U = (c, E) => {
9
+ for (var o in E || (E = {}))
10
+ B.call(E, o) && P(c, o, E[o]);
11
11
  if (L)
12
- for (var n of L(c))
13
- H.call(c, n) && P(E, n, c[n]);
14
- return E;
15
- }, J = (E, c, n) => new Promise((r, m) => {
16
- var C = (a) => {
12
+ for (var o of L(E))
13
+ H.call(E, o) && P(c, o, E[o]);
14
+ return c;
15
+ }, J = (c, E, o) => new Promise((p, I) => {
16
+ var C = (_) => {
17
17
  try {
18
- O(n.next(a));
18
+ O(o.next(_));
19
19
  } catch (T) {
20
- m(T);
20
+ I(T);
21
21
  }
22
- }, N = (a) => {
22
+ }, N = (_) => {
23
23
  try {
24
- O(n.throw(a));
24
+ O(o.throw(_));
25
25
  } catch (T) {
26
- m(T);
26
+ I(T);
27
27
  }
28
- }, O = (a) => a.done ? r(a.value) : Promise.resolve(a.value).then(C, N);
29
- O((n = n.apply(E, c)).next());
28
+ }, O = (_) => _.done ? p(_.value) : Promise.resolve(_.value).then(C, N);
29
+ O((o = o.apply(c, E)).next());
30
30
  });
31
- const x = j(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", S = "dist", W = "public", Y = "package.json", X = "package-lock.json", q = "tsconfig.json", z = ".gitignore", Q = ".simple-git-hooks.json", Z = "pnpm-lock.yaml", ee = ".git/hooks/", te = ".git/COMMIT_EDITMSG", oe = ".migrate-mongo.config.js", I = F.readJsonSync(s(Y)).name === M ? g(d, S) : g(d, K, M, S), ge = "cyberskill", ye = "src/node/cli/index.ts", A = "eslint", u = "eslint", f = "vitest", $ = "vitest", ne = "@commitlint/cli", se = "@commitlint/config-conventional", v = "commitlint", ce = "lint-staged", h = "lint-staged", Ee = "typescript", _e = "tsc", i = "tsx", V = "git", p = "pnpm", ae = "pnpm exec", Ie = "simple-git-hooks", me = "simple-git-hooks", ie = "@eslint/config-inspector", pe = "eslint-config-inspector", re = "node-modules-inspector", Ce = "node-modules-inspector", l = "migrate-mongo", G = "./node_modules/migrate-mongo/bin/migrate-mongo", R = "storybook", k = "storybook", _ = {
32
- CYBERSKILL_DIRECTORY: I,
31
+ const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", S = "dist", W = "public", Y = "package.json", X = "package-lock.json", q = "tsconfig.json", z = ".gitignore", Z = ".simple-git-hooks.json", Q = "pnpm-lock.yaml", ee = ".git/hooks/", te = ".git/COMMIT_EDITMSG", ne = ".migrate-mongo.config.js", m = F.readJsonSync(s(Y)).name === M ? y(d, S) : y(d, K, M, S), ye = "cyberskill", ge = "src/node/cli/index.ts", A = "eslint", u = "eslint", f = "vitest", $ = "vitest", oe = "@commitlint/cli", se = "@commitlint/config-conventional", h = "commitlint", ce = "lint-staged", v = "lint-staged", Ee = "typescript", ae = "tsc", i = "tsx", V = "git", r = "pnpm", _e = "pnpm exec", me = "simple-git-hooks", Ie = "simple-git-hooks", ie = "@eslint/config-inspector", re = "eslint-config-inspector", pe = "node-modules-inspector", Ce = "node-modules-inspector", l = "migrate-mongo", G = "./node_modules/migrate-mongo/bin/migrate-mongo", R = "storybook", k = "storybook", a = {
32
+ CYBERSKILL_DIRECTORY: m,
33
33
  WORKING_DIRECTORY: d,
34
34
  PUBLIC_DIRECTORY: s(W),
35
35
  TS_CONFIG: s(q),
36
36
  GIT_IGNORE: s(z),
37
37
  GIT_HOOK: s(ee),
38
38
  GIT_COMMIT_MSG: s(te),
39
- SIMPLE_GIT_HOOKS_JSON: s(Q),
39
+ SIMPLE_GIT_HOOKS_JSON: s(Z),
40
40
  PACKAGE_JSON: s(Y),
41
41
  PACKAGE_LOCK_JSON: s(X),
42
- PNPM_LOCK_YAML: s(Z),
42
+ PNPM_LOCK_YAML: s(Q),
43
43
  NODE_MODULES: s(K),
44
- MIGRATE_MONGO_CONFIG: s(oe),
45
- LINT_STAGED_CONFIG: s(`${I}/config/lint-staged/index.js`),
46
- COMMITLINT_CONFIG: s(`${I}/config/commitlint/index.js`),
47
- VITEST_UNIT_CONFIG: s(`${I}/config/vitest/vitest.unit.js`),
48
- VITEST_E2E_CONFIG: s(`${I}/config/vitest/vitest.e2e.js`),
49
- STORYBOOK_MAIN_CONFIG: s(`${I}/config/storybook/storybook.main.js`),
50
- STORYBOOK_PREVIEW_CONFIG: s(`${I}/config/storybook/storybook.preview.js`)
44
+ MIGRATE_MONGO_CONFIG: s(ne),
45
+ LINT_STAGED_CONFIG: s(`${m}/config/lint-staged/index.js`),
46
+ COMMITLINT_CONFIG: s(`${m}/config/commitlint/index.js`),
47
+ VITEST_UNIT_CONFIG: s(`${m}/config/vitest/vitest.unit.js`),
48
+ VITEST_E2E_CONFIG: s(`${m}/config/vitest/vitest.e2e.js`),
49
+ STORYBOOK_MAIN_CONFIG: s(`${m}/config/storybook/storybook.main.js`),
50
+ STORYBOOK_PREVIEW_CONFIG: s(`${m}/config/storybook/storybook.preview.js`)
51
51
  };
52
- function Le({ isCurrentProject: E }) {
52
+ function Le({ isCurrentProject: c }) {
53
53
  return U({
54
- "pre-commit": h,
55
- "commit-msg": v
56
- }, E && { "pre-push": D(`${V} pull`) });
54
+ "pre-commit": v,
55
+ "commit-msg": h
56
+ }, c && { "pre-push": D(`${V} pull`) });
57
57
  }
58
- function t({ type: E, packages: c, command: n }) {
59
- const r = c == null ? void 0 : c.reduce((m, C) => (m.some((N) => N.name === C.name) || m.push(C), m), []);
58
+ function t({ type: c, packages: E, command: o }) {
59
+ const p = E == null ? void 0 : E.reduce((I, C) => (I.some((N) => N.name === C.name) || I.push(C), I), []);
60
60
  return () => J(null, null, function* () {
61
- switch (E) {
61
+ switch (c) {
62
62
  case e.CLI:
63
- return r != null && r.length && (yield b(r, {
63
+ return p != null && p.length && (yield b(p, {
64
64
  install: !0
65
- })), y(D(`${ae} ${n}`));
65
+ })), g(D(`${_e} ${o}`));
66
66
  case e.STRING:
67
- return y(D(n));
67
+ return g(D(o));
68
68
  default:
69
69
  throw new Error("Unsupported command type");
70
70
  }
@@ -75,28 +75,28 @@ const Pe = {
75
75
  type: e.CLI,
76
76
  packages: [
77
77
  {
78
- name: Ie,
79
- type: o.DEV_DEPENDENCY
78
+ name: me,
79
+ type: n.DEV_DEPENDENCY
80
80
  }
81
81
  ],
82
- command: me
82
+ command: Ie
83
83
  }),
84
84
  eslintInspect: t({
85
85
  type: e.CLI,
86
86
  packages: [
87
87
  {
88
88
  name: ie,
89
- type: o.DEV_DEPENDENCY
89
+ type: n.DEV_DEPENDENCY
90
90
  }
91
91
  ],
92
- command: pe
92
+ command: re
93
93
  }),
94
94
  nodeModulesInspect: t({
95
95
  type: e.CLI,
96
96
  packages: [
97
97
  {
98
- name: re,
99
- type: o.DEV_DEPENDENCY
98
+ name: pe,
99
+ type: n.DEV_DEPENDENCY
100
100
  }
101
101
  ],
102
102
  command: Ce
@@ -106,151 +106,155 @@ const Pe = {
106
106
  packages: [
107
107
  {
108
108
  name: A,
109
- type: o.DEV_DEPENDENCY
109
+ type: n.DEV_DEPENDENCY
110
110
  }
111
111
  ],
112
- command: `${u} ${_.WORKING_DIRECTORY} --no-cache`
112
+ command: `${u} ${a.WORKING_DIRECTORY} --no-cache`
113
113
  }),
114
114
  eslintFix: t({
115
115
  type: e.CLI,
116
116
  packages: [
117
117
  {
118
118
  name: A,
119
- type: o.DEV_DEPENDENCY
119
+ type: n.DEV_DEPENDENCY
120
120
  }
121
121
  ],
122
- command: `${u} ${_.WORKING_DIRECTORY} --fix --no-cache`
122
+ command: `${u} ${a.WORKING_DIRECTORY} --fix --no-cache`
123
123
  }),
124
124
  typescriptCheck: t({
125
125
  type: e.CLI,
126
126
  packages: [
127
127
  {
128
128
  name: Ee,
129
- type: o.DEV_DEPENDENCY
129
+ type: n.DEV_DEPENDENCY
130
130
  }
131
131
  ],
132
- command: `${_e} -p ${_.TS_CONFIG} --noEmit`
132
+ command: `${ae} -p ${a.TS_CONFIG} --noEmit`
133
133
  }),
134
134
  testUnit: t({
135
135
  type: e.CLI,
136
136
  packages: [
137
137
  {
138
138
  name: f,
139
- type: o.DEV_DEPENDENCY
139
+ type: n.DEV_DEPENDENCY
140
140
  }
141
141
  ],
142
- command: `${$} --config ${_.VITEST_UNIT_CONFIG}`
142
+ command: `${$} --config ${a.VITEST_UNIT_CONFIG}`
143
143
  }),
144
144
  testE2e: t({
145
145
  type: e.CLI,
146
146
  packages: [
147
147
  {
148
148
  name: f,
149
- type: o.DEV_DEPENDENCY
149
+ type: n.DEV_DEPENDENCY
150
150
  }
151
151
  ],
152
- command: `${$} --config ${_.VITEST_E2E_CONFIG}`
152
+ command: `${$} --config ${a.VITEST_E2E_CONFIG}`
153
153
  }),
154
- mongoMigrateCreate: (E) => t({
155
- type: e.CLI,
156
- packages: [
157
- {
158
- name: i,
159
- type: o.DEPENDENCY
160
- },
161
- {
162
- name: l,
163
- type: o.DEPENDENCY
164
- }
165
- ],
166
- command: `${i} ${G} create ${E} -f ${_.MIGRATE_MONGO_CONFIG}`
167
- })(),
154
+ mongoMigrateCreate: (c) => {
155
+ if (!/^[a-zA-Z0-9_-]+$/.test(c))
156
+ throw new Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");
157
+ return t({
158
+ type: e.CLI,
159
+ packages: [
160
+ {
161
+ name: i,
162
+ type: n.DEPENDENCY
163
+ },
164
+ {
165
+ name: l,
166
+ type: n.DEPENDENCY
167
+ }
168
+ ],
169
+ command: `${i} ${G} create ${c} -f ${a.MIGRATE_MONGO_CONFIG}`
170
+ })();
171
+ },
168
172
  mongoMigrateUp: t({
169
173
  type: e.CLI,
170
174
  packages: [
171
175
  {
172
176
  name: i,
173
- type: o.DEPENDENCY
177
+ type: n.DEPENDENCY
174
178
  },
175
179
  {
176
180
  name: l,
177
- type: o.DEPENDENCY
181
+ type: n.DEPENDENCY
178
182
  }
179
183
  ],
180
- command: `${i} ${G} up -f ${_.MIGRATE_MONGO_CONFIG}`
184
+ command: `${i} ${G} up -f ${a.MIGRATE_MONGO_CONFIG}`
181
185
  }),
182
186
  mongoMigrateDown: t({
183
187
  type: e.CLI,
184
188
  packages: [
185
189
  {
186
190
  name: i,
187
- type: o.DEPENDENCY
191
+ type: n.DEPENDENCY
188
192
  },
189
193
  {
190
194
  name: l,
191
- type: o.DEPENDENCY
195
+ type: n.DEPENDENCY
192
196
  }
193
197
  ],
194
- command: `${i} ${G} down -f ${_.MIGRATE_MONGO_CONFIG}`
198
+ command: `${i} ${G} down -f ${a.MIGRATE_MONGO_CONFIG}`
195
199
  }),
196
200
  commitLint: t({
197
201
  type: e.CLI,
198
202
  packages: [
199
203
  {
200
- name: ne,
201
- type: o.DEV_DEPENDENCY
204
+ name: oe,
205
+ type: n.DEV_DEPENDENCY
202
206
  },
203
207
  {
204
208
  name: se,
205
- type: o.DEV_DEPENDENCY
209
+ type: n.DEV_DEPENDENCY
206
210
  }
207
211
  ],
208
- command: `${v} --edit ${_.GIT_COMMIT_MSG} --config ${_.COMMITLINT_CONFIG}`
212
+ command: `${h} --edit ${a.GIT_COMMIT_MSG} --config ${a.COMMITLINT_CONFIG}`
209
213
  }),
210
214
  lintStaged: t({
211
215
  type: e.CLI,
212
216
  packages: [
213
217
  {
214
218
  name: ce,
215
- type: o.DEV_DEPENDENCY
219
+ type: n.DEV_DEPENDENCY
216
220
  }
217
221
  ],
218
- command: `${h} --config ${_.LINT_STAGED_CONFIG}`
222
+ command: `${v} --config ${a.LINT_STAGED_CONFIG}`
219
223
  }),
220
224
  configureGitHook: t({
221
225
  type: e.STRING,
222
- command: `${V} config core.hooksPath ${_.GIT_HOOK}`
226
+ command: `${V} config core.hooksPath ${a.GIT_HOOK}`
223
227
  }),
224
228
  build: t({
225
229
  type: e.STRING,
226
- command: `${p} run --if-present build`
230
+ command: `${r} run --if-present build`
227
231
  }),
228
232
  pnpmInstallStandard: t({
229
233
  type: e.STRING,
230
- command: `${p} install --ignore-scripts`
234
+ command: `${r} install --ignore-scripts`
231
235
  }),
232
236
  pnpmInstallLegacy: t({
233
237
  type: e.STRING,
234
- command: `${p} install --ignore-scripts --legacy-peer-deps`
238
+ command: `${r} install --ignore-scripts --legacy-peer-deps`
235
239
  }),
236
240
  pnpmInstallForce: t({
237
241
  type: e.STRING,
238
- command: `${p} install --ignore-scripts --force`
242
+ command: `${r} install --ignore-scripts --force`
239
243
  }),
240
244
  pnpmPruneStore: t({
241
245
  type: e.STRING,
242
- command: `${p} store prune`
246
+ command: `${r} store prune`
243
247
  }),
244
248
  pnpmCleanCache: t({
245
249
  type: e.STRING,
246
- command: `${p} cache delete`
250
+ command: `${r} cache delete`
247
251
  }),
248
252
  storybookDev: t({
249
253
  type: e.CLI,
250
254
  packages: [
251
255
  {
252
256
  name: R,
253
- type: o.DEV_DEPENDENCY
257
+ type: n.DEV_DEPENDENCY
254
258
  }
255
259
  ],
256
260
  command: `${k} dev`
@@ -260,7 +264,7 @@ const Pe = {
260
264
  packages: [
261
265
  {
262
266
  name: R,
263
- type: o.DEV_DEPENDENCY
267
+ type: n.DEV_DEPENDENCY
264
268
  }
265
269
  ],
266
270
  command: `${k} build`
@@ -268,43 +272,43 @@ const Pe = {
268
272
  };
269
273
  export {
270
274
  S as BUILD_DIRECTORY,
271
- v as COMMIT_LINT_CLI,
275
+ h as COMMIT_LINT_CLI,
272
276
  se as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
273
- ne as COMMIT_LINT_PACKAGE_NAME,
274
- ge as CYBERSKILL_CLI,
275
- ye as CYBERSKILL_CLI_PATH,
276
- I as CYBERSKILL_DIRECTORY,
277
+ oe as COMMIT_LINT_PACKAGE_NAME,
278
+ ye as CYBERSKILL_CLI,
279
+ ge as CYBERSKILL_CLI_PATH,
280
+ m as CYBERSKILL_DIRECTORY,
277
281
  M as CYBERSKILL_PACKAGE_NAME,
278
282
  u as ESLINT_CLI,
279
- pe as ESLINT_INSPECT_CLI,
283
+ re as ESLINT_INSPECT_CLI,
280
284
  ie as ESLINT_INSPECT_PACKAGE_NAME,
281
285
  A as ESLINT_PACKAGE_NAME,
282
286
  V as GIT_CLI,
283
287
  te as GIT_COMMIT_EDITMSG,
284
288
  ee as GIT_HOOK,
285
289
  z as GIT_IGNORE,
286
- h as LINT_STAGED_CLI,
290
+ v as LINT_STAGED_CLI,
287
291
  ce as LINT_STAGED_PACKAGE_NAME,
288
292
  G as MIGRATE_MONGO_CLI,
289
- oe as MIGRATE_MONGO_CONFIG,
293
+ ne as MIGRATE_MONGO_CONFIG,
290
294
  l as MIGRATE_MONGO_PACKAGE_NAME,
291
295
  K as NODE_MODULES,
292
296
  Ce as NODE_MODULES_INSPECT_CLI,
293
- re as NODE_MODULES_INSPECT_PACKAGE_NAME,
297
+ pe as NODE_MODULES_INSPECT_PACKAGE_NAME,
294
298
  Y as PACKAGE_JSON,
295
299
  X as PACKAGE_LOCK_JSON,
296
- _ as PATH,
297
- p as PNPM_CLI,
298
- ae as PNPM_EXEC_CLI,
299
- Z as PNPM_LOCK_YAML,
300
+ a as PATH,
301
+ r as PNPM_CLI,
302
+ _e as PNPM_EXEC_CLI,
303
+ Q as PNPM_LOCK_YAML,
300
304
  W as PUBLIC_DIRECTORY,
301
- Ie as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
302
- me as SIMPLE_GIT_HOOK_CLI,
303
- Q as SIMPLE_GIT_HOOK_JSON,
305
+ me as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
306
+ Ie as SIMPLE_GIT_HOOK_CLI,
307
+ Z as SIMPLE_GIT_HOOK_JSON,
304
308
  k as STORYBOOK_CLI,
305
309
  R as STORYBOOK_PACKAGE_NAME,
306
310
  q as TSCONFIG_JSON,
307
- _e as TSC_CLI,
311
+ ae as TSC_CLI,
308
312
  Ee as TSC_PACKAGE_NAME,
309
313
  i as TSX_CLI,
310
314
  $ as VITEST_CLI,
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { default as pathNode } from 'node:path';
2
- export declare const path: pathNode.PlatformPath;
3
- export declare const dirname: (path: string) => string;
2
+ export declare const path: typeof pathNode;
3
+ export declare const dirname: typeof pathNode.dirname;
4
4
  /**
5
5
  * Resolves a path relative to the current working directory.
6
6
  * This function creates an absolute path by combining the current working directory
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("clsx"),a=require("react"),l=require("./loading.module.scss.cjs");var _=Object.defineProperty,o=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,m=(e,r,t)=>r in e?_(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,p=(e,r)=>{for(var t in r||(r={}))f.call(r,t)&&m(e,t,r[t]);if(o)for(var t of o(r))u.call(r,t)&&m(e,t,r[t]);return e},y=(e,r)=>{var t={};for(var n in e)f.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&o)for(var n of o(e))r.indexOf(n)<0&&u.call(e,n)&&(t[n]=e[n]);return t};function E(){if(document.getElementById("noscroll-style"))return;const e=document.createElement("style");e.id="noscroll-style",e.innerHTML=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("clsx"),n=require("react"),l=require("./loading.module.scss.cjs");var p=Object.defineProperty,i=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,u=(e,r,t)=>r in e?p(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,_=(e,r)=>{for(var t in r||(r={}))m.call(r,t)&&u(e,t,r[t]);if(i)for(var t of i(r))f.call(r,t)&&u(e,t,r[t]);return e},y=(e,r)=>{var t={};for(var a in e)m.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&i)for(var a of i(e))r.indexOf(a)<0&&f.call(e,a)&&(t[a]=e[a]);return t};function E(){if(document.getElementById("noscroll-style"))return;const e=document.createElement("style");e.id="noscroll-style",e.innerHTML=`
2
2
  .noscroll {
3
3
  overflow: hidden !important;
4
4
  height: 100vh !important;
5
5
  }
6
- `,document.head.appendChild(e)}function N(e){var r=e,{full:t=!1,className:n="",message:i="Loading"}=r,v=y(r,["full","className","message"]);a.useEffect(()=>{if(t){document.body.classList.add("noscroll");const c=g=>g.preventDefault();return document.addEventListener("contextmenu",c),()=>{document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",c)}}},[t]),a.useEffect(()=>{E()},[]);function s(){return a.createElement("div",p({className:l.default.container},v),a.createElement("div",{className:l.default.ring}),a.createElement("div",{className:l.default.ring}),a.createElement("div",{className:l.default.ring}),a.createElement("div",{className:l.default.ring}),i&&a.createElement("div",{className:l.default.message},i))}return t?a.createElement("div",{className:d(l.default.full,n)},s()):a.createElement("div",{className:d(l.default.block,n)},s())}exports.Loading=N;
6
+ `,document.head.appendChild(e)}function h(e){var r=e,{full:t=!1,className:a="",message:o="Loading"}=r,v=y(r,["full","className","message"]);n.useEffect(()=>{if(t){document.body.classList.add("noscroll");const s=g=>g.preventDefault();return document.addEventListener("contextmenu",s),()=>{document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",s)}}},[t]),n.useEffect(()=>{E()},[]);function d(){return n.createElement("div",_({role:"status","aria-live":"polite","aria-label":o,className:l.default.container},v),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),o&&n.createElement("div",{className:l.default.message},o))}return t?n.createElement("div",{className:c(l.default.full,a)},d()):n.createElement("div",{className:c(l.default.block,a)},d())}exports.Loading=h;
@@ -1,23 +1,23 @@
1
1
  import m from "clsx";
2
- import a, { useEffect as d } from "react";
2
+ import n, { useEffect as d } from "react";
3
3
  import l from "./loading.module.scss.js";
4
- var _ = Object.defineProperty, o = Object.getOwnPropertySymbols, v = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable, f = (e, r, t) => r in e ? _(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, y = (e, r) => {
4
+ var _ = Object.defineProperty, i = Object.getOwnPropertySymbols, u = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable, f = (e, r, t) => r in e ? _(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, y = (e, r) => {
5
5
  for (var t in r || (r = {}))
6
- v.call(r, t) && f(e, t, r[t]);
7
- if (o)
8
- for (var t of o(r))
9
- u.call(r, t) && f(e, t, r[t]);
6
+ u.call(r, t) && f(e, t, r[t]);
7
+ if (i)
8
+ for (var t of i(r))
9
+ v.call(r, t) && f(e, t, r[t]);
10
10
  return e;
11
11
  }, E = (e, r) => {
12
12
  var t = {};
13
- for (var n in e)
14
- v.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
15
- if (e != null && o)
16
- for (var n of o(e))
17
- r.indexOf(n) < 0 && u.call(e, n) && (t[n] = e[n]);
13
+ for (var a in e)
14
+ u.call(e, a) && r.indexOf(a) < 0 && (t[a] = e[a]);
15
+ if (e != null && i)
16
+ for (var a of i(e))
17
+ r.indexOf(a) < 0 && v.call(e, a) && (t[a] = e[a]);
18
18
  return t;
19
19
  };
20
- function N() {
20
+ function h() {
21
21
  if (document.getElementById("noscroll-style"))
22
22
  return;
23
23
  const e = document.createElement("style");
@@ -28,8 +28,8 @@ function N() {
28
28
  }
29
29
  `, document.head.appendChild(e);
30
30
  }
31
- function b(e) {
32
- var r = e, { full: t = !1, className: n = "", message: s = "Loading" } = r, p = E(r, ["full", "className", "message"]);
31
+ function L(e) {
32
+ var r = e, { full: t = !1, className: a = "", message: o = "Loading" } = r, p = E(r, ["full", "className", "message"]);
33
33
  d(() => {
34
34
  if (t) {
35
35
  document.body.classList.add("noscroll");
@@ -39,13 +39,26 @@ function b(e) {
39
39
  };
40
40
  }
41
41
  }, [t]), d(() => {
42
- N();
42
+ h();
43
43
  }, []);
44
- function i() {
45
- return /* @__PURE__ */ a.createElement("div", y({ className: l.container }, p), /* @__PURE__ */ a.createElement("div", { className: l.ring }), /* @__PURE__ */ a.createElement("div", { className: l.ring }), /* @__PURE__ */ a.createElement("div", { className: l.ring }), /* @__PURE__ */ a.createElement("div", { className: l.ring }), s && /* @__PURE__ */ a.createElement("div", { className: l.message }, s));
44
+ function s() {
45
+ return /* @__PURE__ */ n.createElement(
46
+ "div",
47
+ y({
48
+ role: "status",
49
+ "aria-live": "polite",
50
+ "aria-label": o,
51
+ className: l.container
52
+ }, p),
53
+ /* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
54
+ /* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
55
+ /* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
56
+ /* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
57
+ o && /* @__PURE__ */ n.createElement("div", { className: l.message }, o)
58
+ );
46
59
  }
47
- return t ? /* @__PURE__ */ a.createElement("div", { className: m(l.full, n) }, i()) : /* @__PURE__ */ a.createElement("div", { className: m(l.block, n) }, i());
60
+ return t ? /* @__PURE__ */ n.createElement("div", { className: m(l.full, a) }, s()) : /* @__PURE__ */ n.createElement("div", { className: m(l.block, a) }, s());
48
61
  }
49
62
  export {
50
- b as Loading
63
+ L as Loading
51
64
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,11 @@
1
+ import { HTMLAttributes } from 'react';
1
2
  export interface I_LoadingContext {
2
3
  isLoading: boolean;
3
4
  isGlobalLoading: boolean;
4
5
  showLoading: (global?: boolean) => void;
5
6
  hideLoading: () => void;
6
7
  }
7
- export interface I_LoadingProps {
8
+ export interface I_LoadingProps extends HTMLAttributes<HTMLDivElement> {
8
9
  full?: boolean;
9
10
  block?: boolean;
10
11
  className?: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("unorm"),t=require("../../typescript/common.type.cjs");var m=Object.defineProperty,c=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,a=(e,n,r)=>n in e?m(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,p=(e,n)=>{for(var r in n||(n={}))_.call(n,r)&&a(e,r,n[r]);if(c)for(var r of c(n))O.call(n,r)&&a(e,r,n[r]);return e};const u={a:["à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["è","é","ẹ","ẻ","ẽ","ê","ề","ế","ệ","ể","ễ"],i:["ì","í","ị","ỉ","ĩ"],o:["ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","ý","ỵ","ỷ","ỹ"],d:["đ"]},f=Object.entries(u).reduce((e,[n,r])=>(e[n.toUpperCase()]=r.map(o=>o.toUpperCase()),e),{});function v(e){e=s.nfkc(e);const n=p(p({},u),f);for(const[r,o]of Object.entries(n)){const i=`[${r}${o.join("")}]`,E=`(${[r,...o].join("|")})`;e=e.replace(new RegExp(i,"g"),E)}return e}function l(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 i of e){const E=n(i);r.has(E)||(r.add(E),o.push(i))}return o}function N(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,i=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:i,IS_PROD:E}}exports.mapEnvironment=N;exports.regexSearchMapper=v;exports.removeAccent=l;exports.uniqueArray=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../typescript/common.type.cjs");var s=Object.defineProperty,a=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,c=(e,n,r)=>n in e?s(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,p=(e,n)=>{for(var r in n||(n={}))m.call(n,r)&&c(e,r,n[r]);if(a)for(var r of a(n))_.call(n,r)&&c(e,r,n[r]);return e};const u={a:["à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["è","é","ẹ","ẻ","ẽ","ê","ề","ế","ệ","ể","ễ"],i:["ì","í","ị","ỉ","ĩ"],o:["ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","ý","ỵ","ỷ","ỹ"],d:["đ"]},O=Object.entries(u).reduce((e,[n,r])=>(e[n.toUpperCase()]=r.map(o=>o.toUpperCase()),e),{});function v(e){e=e.normalize("NFD");const n=p(p({},u),O);for(const[r,o]of Object.entries(n)){const i=`[${r}${o.join("")}]`,E=`(${[r,...o].join("|")})`;e=e.replace(new RegExp(i,"g"),E)}return e}function f(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}function l(e,n){if(!n)return Array.from(new Set(e));const r=new Set,o=[];for(const i of e){const E=n(i);r.has(E)||(r.add(E),o.push(i))}return o}function D(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,i=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:i,IS_PROD:E}}exports.mapEnvironment=D;exports.regexSearchMapper=v;exports.removeAccent=f;exports.uniqueArray=l;
@@ -1,11 +1,10 @@
1
- import u from "unorm";
2
1
  import { E_Environment as t } from "../../typescript/common.type.js";
3
- var O = Object.defineProperty, p = Object.getOwnPropertySymbols, f = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable, i = (e, r, n) => r in e ? O(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, E = (e, r) => {
2
+ var u = Object.defineProperty, i = Object.getOwnPropertySymbols, O = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable, p = (e, r, n) => r in e ? u(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, E = (e, r) => {
4
3
  for (var n in r || (r = {}))
5
- f.call(r, n) && i(e, n, r[n]);
6
- if (p)
7
- for (var n of p(r))
8
- m.call(r, n) && i(e, n, r[n]);
4
+ O.call(r, n) && p(e, n, r[n]);
5
+ if (i)
6
+ for (var n of i(r))
7
+ f.call(r, n) && p(e, n, r[n]);
9
8
  return e;
10
9
  };
11
10
  const s = {
@@ -20,8 +19,8 @@ const s = {
20
19
  (e, [r, n]) => (e[r.toUpperCase()] = n.map((o) => o.toUpperCase()), e),
21
20
  {}
22
21
  );
23
- function P(e) {
24
- e = u.nfkc(e);
22
+ function D(e) {
23
+ e = e.normalize("NFD");
25
24
  const r = E(E({}, s), _);
26
25
  for (const [n, o] of Object.entries(r)) {
27
26
  const a = `[${n}${o.join("")}]`, c = `(${[n, ...o].join("|")})`;
@@ -29,10 +28,10 @@ function P(e) {
29
28
  }
30
29
  return e;
31
30
  }
32
- function l(e) {
31
+ function N(e) {
33
32
  return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
34
33
  }
35
- function v(e, r) {
34
+ function l(e, r) {
36
35
  if (!r)
37
36
  return Array.from(new Set(e));
38
37
  const n = /* @__PURE__ */ new Set(), o = [];
@@ -42,15 +41,15 @@ function v(e, r) {
42
41
  }
43
42
  return o;
44
43
  }
45
- function d(e) {
44
+ function P(e) {
46
45
  const { NODE_ENV: r = t.DEVELOPMENT, NODE_ENV_MODE: n = t.DEVELOPMENT } = e, o = r === t.DEVELOPMENT && n === t.DEVELOPMENT, a = r === t.PRODUCTION && n === t.STAGING, c = r === t.PRODUCTION && n === t.PRODUCTION;
47
46
  if (r === t.PRODUCTION && n === t.DEVELOPMENT)
48
47
  throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");
49
48
  return { IS_DEV: o, IS_STAG: a, IS_PROD: c };
50
49
  }
51
50
  export {
52
- d as mapEnvironment,
53
- P as regexSearchMapper,
54
- l as removeAccent,
55
- v as uniqueArray
51
+ P as mapEnvironment,
52
+ D as regexSearchMapper,
53
+ N as removeAccent,
54
+ l as uniqueArray
56
55
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./common/common.util.cjs"),e=require("./object/object.util.cjs"),a=require("./serializer/serializer.util.cjs"),r=require("./string/string.util.cjs"),i=require("./validate/validate.util.cjs");exports.mapEnvironment=t.mapEnvironment;exports.regexSearchMapper=t.regexSearchMapper;exports.removeAccent=t.removeAccent;exports.uniqueArray=t.uniqueArray;exports.deepMerge=e.deepMerge;exports.getNestedValue=e.getNestedValue;exports.isJSON=e.isJSON;exports.normalizeMongoFilter=e.normalizeMongoFilter;exports.setNestedValue=e.setNestedValue;exports.serializer=a.serializer;exports.generateRandomPassword=r.generateRandomPassword;exports.generateShortId=r.generateShortId;exports.generateSlug=r.generateSlug;exports.getFileName=r.getFileName;exports.substringBetween=r.substringBetween;exports.validate=i.validate;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./common/common.util.cjs"),e=require("./object/object.util.cjs"),a=require("./serializer/serializer.util.cjs"),r=require("./string/string.util.cjs"),i=require("./validate/validate.util.cjs");exports.mapEnvironment=t.mapEnvironment;exports.regexSearchMapper=t.regexSearchMapper;exports.removeAccent=t.removeAccent;exports.uniqueArray=t.uniqueArray;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.serializer=a.serializer;exports.generateRandomPassword=r.generateRandomPassword;exports.generateShortId=r.generateShortId;exports.generateSlug=r.generateSlug;exports.getFileName=r.getFileName;exports.substringBetween=r.substringBetween;exports.validate=i.validate;