@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.0-beta.2

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 (152) hide show
  1. package/dist/assertions/index.cjs +1 -1
  2. package/dist/assertions/index.d.ts +96 -116
  3. package/dist/assertions/index.js +1 -1
  4. package/dist/chunk-25G6B35W.js +1 -0
  5. package/dist/chunk-2AUUPGMN.js +1 -0
  6. package/dist/chunk-2JQQQ625.js +1 -0
  7. package/dist/chunk-445TAVT4.cjs +1 -0
  8. package/dist/chunk-467VEMJH.js +1 -0
  9. package/dist/chunk-6Q4I2RPC.cjs +1 -0
  10. package/dist/chunk-6SMJMZ7G.cjs +1 -0
  11. package/dist/chunk-BLCANGFS.js +1 -0
  12. package/dist/chunk-CK3BZGEU.js +1 -0
  13. package/dist/{chunk-JWHM3WZQ.cjs → chunk-D43GV6EF.cjs} +1 -1
  14. package/dist/chunk-DFSTVQFI.cjs +1 -0
  15. package/dist/chunk-DYRDBYPF.cjs +1 -0
  16. package/dist/chunk-EXXLUO7L.cjs +1 -0
  17. package/dist/chunk-G72VSVGO.js +1 -0
  18. package/dist/chunk-GAJTFCUA.js +1 -0
  19. package/dist/chunk-GOJNH55O.cjs +1 -0
  20. package/dist/chunk-HXST7RJB.js +1 -0
  21. package/dist/{chunk-BYZAD3XN.cjs → chunk-HXTACM3O.cjs} +1 -1
  22. package/dist/chunk-IJTZWWRJ.cjs +1 -0
  23. package/dist/chunk-ISJ33O2J.cjs +1 -0
  24. package/dist/chunk-JISH2VGG.js +1 -0
  25. package/dist/{chunk-FF76ISQ2.js → chunk-JQZUWBIX.js} +1 -1
  26. package/dist/{chunk-XH6MCRLP.js → chunk-K4PLGD7C.js} +1 -1
  27. package/dist/chunk-KZQB7H4E.cjs +1 -0
  28. package/dist/chunk-LUVV5KSD.cjs +2 -0
  29. package/dist/chunk-LVUSFXQS.cjs +1 -0
  30. package/dist/chunk-ME5OV5HN.js +1 -0
  31. package/dist/chunk-MF5Y5K4N.cjs +1 -0
  32. package/dist/chunk-MJAW5RAK.js +1 -0
  33. package/dist/chunk-MWLEM7ED.js +1 -0
  34. package/dist/chunk-NSVLG7NY.js +4 -0
  35. package/dist/chunk-NUHOOAUN.cjs +1 -0
  36. package/dist/chunk-NUVGETPD.js +2 -0
  37. package/dist/chunk-O5VXBNUQ.cjs +4 -0
  38. package/dist/chunk-O7SJR4CY.cjs +1 -0
  39. package/dist/chunk-OX6RLS2F.cjs +1 -0
  40. package/dist/chunk-PFLNHD4B.cjs +1 -0
  41. package/dist/chunk-PSWITZK5.js +1 -0
  42. package/dist/chunk-PYUVKHUF.cjs +1 -0
  43. package/dist/chunk-REFMEB4A.js +1 -0
  44. package/dist/chunk-RHE3M2NJ.cjs +1 -0
  45. package/dist/chunk-RHIBYOFQ.js +1 -0
  46. package/dist/chunk-S7GMG4TB.js +1 -0
  47. package/dist/chunk-TQMZ2LPI.js +1 -0
  48. package/dist/{chunk-RN3TP3S3.js → chunk-U4TZO7WV.js} +1 -1
  49. package/dist/chunk-UUMKL74S.js +1 -0
  50. package/dist/{chunk-EXZ47NOW.js → chunk-VQLAPEL3.js} +1 -1
  51. package/dist/chunk-VTR75UID.cjs +1 -0
  52. package/dist/chunk-XFCJDSB2.cjs +1 -0
  53. package/dist/chunk-XOYX4PLZ.cjs +1 -0
  54. package/dist/chunk-Z6FLCEN6.js +1 -0
  55. package/dist/chunk-ZO5364A6.cjs +1 -0
  56. package/dist/conversions/index.cjs +1 -1
  57. package/dist/conversions/index.d.ts +396 -593
  58. package/dist/conversions/index.js +1 -1
  59. package/dist/env/index.d.ts +5 -8
  60. package/dist/events/index.cjs +1 -1
  61. package/dist/events/index.d.ts +80 -77
  62. package/dist/events/index.js +1 -1
  63. package/dist/{array-CIZRbqTF.d.ts → extends-Bk_SBGdT.d.ts} +145 -1
  64. package/dist/formatting/index.cjs +1 -1
  65. package/dist/formatting/index.d.ts +478 -440
  66. package/dist/formatting/index.js +1 -1
  67. package/dist/generator/index.cjs +1 -1
  68. package/dist/generator/index.d.ts +135 -112
  69. package/dist/generator/index.js +1 -1
  70. package/dist/index.cjs +1 -1
  71. package/dist/index.d.ts +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/{is-array-Ckm_47hw.d.ts → is-array--YjXV-Wx.d.ts} +2 -352
  74. package/dist/{isPlainObject-BKYaI6a8.d.ts → isPlainObject-BVhBAPHX.d.ts} +49 -62
  75. package/dist/next/index.cjs +6 -6
  76. package/dist/next/index.d.ts +125 -105
  77. package/dist/next/index.js +5 -5
  78. package/dist/next/server/index.cjs +1 -1
  79. package/dist/next/server/index.d.ts +8 -22
  80. package/dist/next/server/index.js +1 -1
  81. package/dist/operations/index.cjs +1 -1
  82. package/dist/operations/index.d.ts +72 -127
  83. package/dist/operations/index.js +1 -1
  84. package/dist/parsers/index.cjs +1 -1
  85. package/dist/parsers/index.d.ts +26 -27
  86. package/dist/parsers/index.js +1 -1
  87. package/dist/predicates/index.cjs +1 -1
  88. package/dist/predicates/index.d.ts +686 -660
  89. package/dist/predicates/index.js +1 -1
  90. package/dist/promise/index.cjs +1 -1
  91. package/dist/promise/index.d.ts +14 -23
  92. package/dist/promise/index.js +1 -1
  93. package/dist/rzl-utils.global.js +3 -3
  94. package/dist/string-XA-til3C.d.ts +351 -0
  95. package/dist/strings/index.cjs +1 -1
  96. package/dist/strings/index.d.ts +301 -376
  97. package/dist/strings/index.js +1 -1
  98. package/dist/stylings/index.cjs +1 -1
  99. package/dist/stylings/index.d.ts +15 -23
  100. package/dist/stylings/index.js +1 -1
  101. package/dist/types/index.d.ts +1 -1
  102. package/dist/urls/index.cjs +1 -1
  103. package/dist/urls/index.d.ts +276 -301
  104. package/dist/urls/index.js +1 -1
  105. package/package.json +53 -11
  106. package/dist/chunk-2TRAPBZ7.cjs +0 -1
  107. package/dist/chunk-3D74QO5D.cjs +0 -1
  108. package/dist/chunk-4DK3RCC4.js +0 -2
  109. package/dist/chunk-4JOQ45HL.js +0 -1
  110. package/dist/chunk-55CZALRS.js +0 -1
  111. package/dist/chunk-5JFV3GDE.cjs +0 -4
  112. package/dist/chunk-62HX5Z45.cjs +0 -1
  113. package/dist/chunk-7NA6DUHR.cjs +0 -2
  114. package/dist/chunk-BVPMMWDL.cjs +0 -1
  115. package/dist/chunk-CEFYHEM4.cjs +0 -1
  116. package/dist/chunk-CN53M4QZ.cjs +0 -1
  117. package/dist/chunk-D47MHBSD.cjs +0 -1
  118. package/dist/chunk-DGH75GJD.js +0 -1
  119. package/dist/chunk-E5NUI7PN.js +0 -1
  120. package/dist/chunk-FDITZ5C6.cjs +0 -1
  121. package/dist/chunk-FSSV24W7.cjs +0 -1
  122. package/dist/chunk-GCGU2WB7.js +0 -1
  123. package/dist/chunk-GECI2YBP.js +0 -1
  124. package/dist/chunk-GQE4OVHC.cjs +0 -1
  125. package/dist/chunk-GRVZXQXL.cjs +0 -1
  126. package/dist/chunk-I4AVNHPA.cjs +0 -1
  127. package/dist/chunk-JFRL7NKU.js +0 -4
  128. package/dist/chunk-KCQDDZJE.cjs +0 -1
  129. package/dist/chunk-L54ZPSYJ.js +0 -1
  130. package/dist/chunk-LVKAYEZ4.js +0 -1
  131. package/dist/chunk-MBDWTK54.cjs +0 -1
  132. package/dist/chunk-MNGGDB2G.js +0 -1
  133. package/dist/chunk-MY7BA4GI.cjs +0 -1
  134. package/dist/chunk-N2IJPIND.cjs +0 -1
  135. package/dist/chunk-NIMNTEGV.js +0 -1
  136. package/dist/chunk-PVJF2JHM.js +0 -1
  137. package/dist/chunk-QCFXEUKL.js +0 -1
  138. package/dist/chunk-QFCGBBSY.js +0 -1
  139. package/dist/chunk-QQYAUPSK.cjs +0 -1
  140. package/dist/chunk-TC4VBE4Y.cjs +0 -1
  141. package/dist/chunk-TUXDINHF.cjs +0 -1
  142. package/dist/chunk-U5Y2FXMN.cjs +0 -1
  143. package/dist/chunk-UUPQI6ND.cjs +0 -1
  144. package/dist/chunk-VYCGZ2S6.js +0 -1
  145. package/dist/chunk-W5EDKJK3.js +0 -1
  146. package/dist/chunk-WHAVUFEU.js +0 -1
  147. package/dist/chunk-XCFIOTCV.js +0 -1
  148. package/dist/chunk-XE27XPJR.js +0 -1
  149. package/dist/chunk-XVB3ZZEB.js +0 -1
  150. package/dist/chunk-ZBSIGJFO.cjs +0 -1
  151. package/dist/chunk-ZYAML74V.js +0 -1
  152. package/dist/extends-Mp81Hq9-.d.ts +0 -145
@@ -1,4 +1,4 @@
1
- import{I as If}from'./if-CvT4R7Kh.js';import{I as IsNever}from'./never-BfayMBF9.js';import{I as IfExtends,E as Extends,N as Not,a as NotExtends}from'./extends-Mp81Hq9-.js';import{I as IsAny}from'./any-BmdI8UbK.js';import{P as Prettify}from'./prettify-C4xLcYOP.js';
1
+ import{I as IfExtends,E as Extends,N as Not,a as NotExtends}from'./extends-Bk_SBGdT.js';import{I as If}from'./if-CvT4R7Kh.js';import{T as Trim,I as IfNot}from'./string-XA-til3C.js';import{I as IsNever}from'./never-BfayMBF9.js';import{I as IsAny}from'./any-BmdI8UbK.js';import{P as Prettify}from'./prettify-C4xLcYOP.js';
2
2
  /** -------------------------------------------------------
3
3
  * * ***And.***
4
4
  * -------------------------------------------------------
@@ -55,356 +55,6 @@ type AndArr<Conditions extends readonly unknown[]>=Extends<Conditions[number],tr
55
55
  */
56
56
  type IsStringLiteral<T>=If<Extends<T,string>,Extends<string,T>extends true?false:true,false>;
57
57
  /** -------------------------------------------------------
58
- * * ***IfNot.***
59
- * -------------------------------------------------------
60
- *
61
- * Conditional: returns the second argument if the first argument is `false`, otherwise returns the third argument.
62
- * - Defaults: `IfTrue = true`, `IfFalse = false`.
63
- *
64
- * @template Condition - The boolean condition to check.
65
- * @template IfTrue - The branch type if condition is `false`. (default: `true`)
66
- * @template IfFalse - The branch type if condition is `true`. (default: `false`)
67
- *
68
- * ### Examples
69
- * ```ts
70
- * type A = IfNot<false, "valid">;
71
- * // ➔ "valid"
72
- * type B = IfNot<false, "valid", "invalid">;
73
- * // ➔ "invalid"
74
- * ```
75
- */
76
- type IfNot<Condition,IfTrue=true,IfFalse=false>=If<Condition,IfFalse,IfTrue>;
77
- /** -------------------------------------------------------
78
- * * ***WordSeparator.***
79
- * -------------------------------------------------------
80
- * A type-level utility that defines all valid ***word separators***.
81
- * - Can be a space `" "`, a dash `"-"`, or an underscore `"_"`.
82
- *
83
- * @example
84
- * ```ts
85
- * type A = WordSeparator; // ➔ " " | "-" | "_"
86
- * ```
87
- */
88
- type WordSeparator=" "|"-"|"_";
89
- /** --------------------------------------------------
90
- * * ***Whitespace.***
91
- * --------------------------------------------------
92
- * Represents common whitespace characters.
93
- *
94
- * ✅ Used as the default trimming characters in string utility types.
95
- *
96
- * @example
97
- * type W = Whitespace;
98
- * // ➔ " " | "\t" | "\r" | "\n"
99
- */
100
- type Whitespace=" "|"\t"|"\r"|"\n";
101
- /** **Helper Internal.** */
102
- type SafeKeyTrimming<T>=Exclude<T,symbol>;
103
- /** --------------------------------------------------
104
- * * ***TrimLeft.***
105
- * --------------------------------------------------
106
- * Recursively trims specified characters (default: **{@link Whitespace}**)
107
- * from the **start (left)** of a string.
108
- *
109
- * @template Text - The string to trim.
110
- * @template Chars - The characters to remove (default: `Whitespace`).
111
- *
112
- * @example
113
- * type T1 = TrimLeft<"\n hello", " " | "\n">;
114
- * // ➔ "hello"
115
- *
116
- * type T2 = TrimLeft<" world">;
117
- * // ➔ "world"
118
- *
119
- * type T3 = TrimLeft<" world ">;
120
- * // ➔ "world "
121
- */
122
- type TrimLeft<Text extends PropertyKey,Chars extends PropertyKey=Whitespace>=Text extends`${SafeKeyTrimming<Chars>}${infer Rest}`?TrimLeft<Rest,Chars>:Text;
123
- /** --------------------------------------------------
124
- * * ***TrimRight.***
125
- * --------------------------------------------------
126
- * Recursively trims specified characters (default: **{@link Whitespace}**)
127
- * from the **end (right)** of a string.
128
- *
129
- * @template Text - The string to trim.
130
- * @template Chars - The characters to remove (default: `Whitespace`).
131
- *
132
- * @example
133
- * type T1 = TrimRight<"hello \t", " " | "\t">;
134
- * // ➔ "hello"
135
- *
136
- * type T2 = TrimRight<"world ">;
137
- * // ➔ "world"
138
- *
139
- * type T2 = TrimRight<" world ">;
140
- * // ➔ " world"
141
- */
142
- type TrimRight<Text extends PropertyKey,Chars extends PropertyKey=Whitespace>=Text extends`${infer Rest}${SafeKeyTrimming<Chars>}`?TrimRight<Rest,Chars>:Text;
143
- /** --------------------------------------------------
144
- * * ***Trim.***
145
- * --------------------------------------------------
146
- * Trims specified characters (default: **{@link Whitespace}**)
147
- * from **both the start and end** of a string.
148
- *
149
- * @template Text - The string to trim.
150
- * @template Chars - The characters to remove (default: `Whitespace`).
151
- *
152
- * @example
153
- * type T1 = Trim<" hello ", " ">;
154
- * // ➔ "hello"
155
- *
156
- * type T2 = Trim<"\n world \t">;
157
- * // ➔ "world"
158
- */
159
- type Trim<Text extends PropertyKey,Chars extends PropertyKey=Whitespace>=TrimRight<TrimLeft<Text,Chars>,Chars>;
160
- /** -------------------------------------------------------
161
- * * ***TrimsLower***
162
- * -------------------------------------------------------
163
- * Trims leading & trailing whitespace from a string and
164
- * converts it to **lowercase**.
165
- *
166
- * Utilizes **{@link Trim}** to remove whitespace and **{@link Lowercase}** to convert the string to lowercase.
167
- *
168
- * @template S - The input string to transform.
169
- *
170
- * @example
171
- * ```ts
172
- * type T1 = TrimsLower<" HeLLo \n">;
173
- * // ➔ "hello"
174
- *
175
- * type T2 = TrimsLower<" WoRLD ">;
176
- * // ➔ "world"
177
- * ```
178
- */
179
- type TrimsLower<S extends string>=Lowercase<Trim<S>>;
180
- /** -------------------------------------------------------
181
- * * ***TrimsUpper***
182
- * -------------------------------------------------------
183
- * Trims leading & trailing whitespace from a string and
184
- * converts it to **uppercase**.
185
- *
186
- * Utilizes **{@link Trim}** to remove whitespace and **{@link Uppercase}** to convert the string to uppercase.
187
- *
188
- * @template S - The input string to transform.
189
- *
190
- * @example
191
- * ```ts
192
- * type T1 = TrimsUpper<" HeLLo \n">;
193
- * // ➔ "HELLO"
194
- *
195
- * type T2 = TrimsUpper<" WoRLD ">;
196
- * // ➔ "WORLD"
197
- * ```
198
- */
199
- type TrimsUpper<S extends string>=Uppercase<Trim<S>>;
200
- /** -------------------------------------------------------
201
- * * ***AnyString.***
202
- * -------------------------------------------------------
203
- *
204
- * A utility type that represents **any string value** while
205
- * preventing unwanted widening of string literals to `string`.
206
- *
207
- * 🔹 This is achieved by intersecting `string` with `{}`,
208
- * ensuring that the type remains assignable to `string`
209
- * but is treated as a unique type in generic constraints.
210
- *
211
- * 📌 Useful in scenarios where:
212
- * - You want to accept **any string**, but still preserve
213
- * literal types in inference.
214
- * - You need stricter typing than just `string`.
215
- *
216
- * @example
217
- * ```ts
218
- * declare function acceptsAnyString<T extends AnyString>(value: T): T;
219
- *
220
- * // Preserves literal
221
- * const a = acceptsAnyString("hello");
222
- * // ➔ "hello"
223
- *
224
- * // Also allows generic string
225
- * const b = acceptsAnyString(String("world"));
226
- * // ➔ string
227
- * ```
228
- */
229
- type AnyString={}& string;
230
- /** -------------------------------------------------------
231
- * * ***EmptyString.***
232
- * -------------------------------------------------------
233
- * Returns the type `T` only if it is the empty string `""`.
234
- * Optionally trims whitespace before checking.
235
- *
236
- * Behavior:
237
- * - If `WithTrim` is `true` (default), trims `T` before checking.
238
- * - If `T` is the general `string` type, returns `never`.
239
- * - If `T` is empty (after optional trimming), returns `T` or `Trim<T>`.
240
- *
241
- * @template T - The string type to check.
242
- * @template WithTrim - Whether to trim whitespace before checking (default `true`).
243
- *
244
- * @example
245
- * ```ts
246
- * // Basic empty string
247
- * type Case1 = EmptyString<"">;
248
- * // ➔ ""
249
- *
250
- * // Non-empty string
251
- * type Case2 = EmptyString<"abc">;
252
- * // ➔ never
253
- *
254
- * // General string type
255
- * type Case3 = EmptyString<string>;
256
- * // ➔ never
257
- *
258
- * // With leading/trailing whitespace
259
- * type Case4 = EmptyString<" ", true>;
260
- * // ➔ "" (trimmed)
261
- * type Case5 = EmptyString<" ", false>;
262
- * // ➔ never (not trimmed)
263
- * ```
264
- */
265
- type EmptyString<T extends string,WithTrim extends boolean=true>=""extends(WithTrim extends true?Trim<T>:T)?string extends(WithTrim extends true?Trim<T>:T)?never:WithTrim extends true?Trim<T>:T:never;
266
- /** -------------------------------------------------------
267
- * * ***NonEmptyString.***
268
- * -------------------------------------------------------
269
- * Returns the type `T` only if it is a non-empty string.
270
- * Optionally trims whitespace before checking.
271
- *
272
- * Behavior:
273
- * - If `WithTrim` is `true` (default), trims `T` before checking.
274
- * - If `T` is the general `string` type, returns `string`.
275
- * - If `T` is empty (after optional trimming), returns `never`.
276
- *
277
- * @template T - The string type to check.
278
- * @template WithTrim - Whether to trim whitespace before checking (default `true`).
279
- *
280
- * @example
281
- * ```ts
282
- * // Non-empty string
283
- * type Case1 = NonEmptyString<"abc">; // ➔ "abc"
284
- *
285
- * // Empty string
286
- * type Case2 = NonEmptyString<"">; // ➔ never
287
- *
288
- * // General string type
289
- * type Case3 = NonEmptyString<string>; // ➔ string
290
- *
291
- * // String with whitespace
292
- * type Case4 = NonEmptyString<" ", true>; // ➔ never (trimmed to empty)
293
- * type Case5 = NonEmptyString<" ", false>; // ➔ " " (not trimmed)
294
- * ```
295
- */
296
- type NonEmptyString<T extends string,WithTrim extends boolean=true>=string extends T?string:If<IsNever<EmptyString<T,WithTrim>>,WithTrim extends true?Trim<T>:T,never>;
297
- /** -------------------------------------------------------
298
- * * ***IsEmptyString.***
299
- * -------------------------------------------------------
300
- * Returns `true` if `T` is exactly the empty string `""`.
301
- * Optionally trims whitespace before checking.
302
- *
303
- * Behavior:
304
- * - If `WithTrim` is `true` (default), trims `T` before checking.
305
- * - If `T` is empty after optional trimming, returns `true`.
306
- * - Otherwise, returns `false`.
307
- *
308
- * @template T - The string type to check.
309
- * @template WithTrim - Whether to trim whitespace before checking (default `true`).
310
- *
311
- * @example
312
- * ```ts
313
- * type Case1 = IsEmptyString<"">;
314
- * // ➔ true
315
- * type Case2 = IsEmptyString<"abc">;
316
- * // ➔ false
317
- * type Case3 = IsEmptyString<" ", true>;
318
- * // ➔ true (trimmed)
319
- * type Case4 = IsEmptyString<" ", false>;
320
- * // ➔ false (not trimmed)
321
- * ```
322
- */
323
- type IsEmptyString<T extends string,WithTrim extends boolean=true>=IfNot<IsNever<EmptyString<T,WithTrim>>>;
324
- /** -------------------------------------------------------
325
- * * ***IsNonEmptyString.***
326
- * -------------------------------------------------------
327
- * Returns `true` if `T` is a non-empty string.
328
- * Optionally trims whitespace before checking.
329
- *
330
- * Behavior:
331
- * - If `WithTrim` is `true` (default), trims `T` before checking.
332
- * - Returns `true` if `T` is non-empty after optional trimming.
333
- * - Returns `false` if `T` is empty (after trimming if `WithTrim=true`).
334
- *
335
- * @template T - The string type to check.
336
- * @template WithTrim - Whether to trim whitespace before checking (default `true`).
337
- *
338
- * @example
339
- * ```ts
340
- * type Case1 = IsNonEmptyString<"abc">;
341
- * // ➔ true
342
- * type Case2 = IsNonEmptyString<"">;
343
- * // ➔ false
344
- * type Case3 = IsNonEmptyString<" ", true>;
345
- * // ➔ false (trimmed)
346
- * type Case4 = IsNonEmptyString<" ", false>;
347
- * // ➔ true (not trimmed)
348
- * ```
349
- */
350
- type IsNonEmptyString<T extends string,WithTrim extends boolean=true>=IfNot<IsNever<NonEmptyString<T,WithTrim>>>;
351
- /** -------------------------------------------------------
352
- * * ***IfEmptyString.***
353
- * -------------------------------------------------------
354
- * Conditional type: returns `IfTrue` if `T` is an empty string `""`,
355
- * otherwise returns `IfFalse`. Optionally trims whitespace before checking.
356
- *
357
- * @template T - The string type to check.
358
- * @template IfTrue - Type returned if `T` is empty (default `true`).
359
- * @template IfFalse - Type returned if `T` is not empty (default `false`).
360
- * @template WithTrim - Whether to trim whitespace before checking (default `true`).
361
- *
362
- * @example
363
- * ```ts
364
- * type Case1 = IfEmptyString<"">;
365
- * // ➔ true
366
- * type Case2 = IfEmptyString<"abc">;
367
- * // ➔ false
368
- * type Case3 = IfEmptyString<"", "yes", "no">;
369
- * // ➔ "yes"
370
- * type Case4 = IfEmptyString<"abc", "yes", "no">;
371
- * // ➔ "no"
372
- * type Case5 = IfEmptyString<" ", "yes", "no", true>;
373
- * // ➔ "yes" (trimmed)
374
- * type Case6 = IfEmptyString<" ", "yes", "no", false>;
375
- * // ➔ "no" (not trimmed)
376
- * ```
377
- */
378
- type IfEmptyString<T extends string,IfTrue=true,IfFalse=false,WithTrim extends boolean=true>=IfNot<IsNever<EmptyString<T,WithTrim>>,IfTrue,IfFalse>;
379
- /** -------------------------------------------------------
380
- * * ***IfNonEmptyString.***
381
- * -------------------------------------------------------
382
- * Conditional type: returns `IfTrue` if `T` is a non-empty string,
383
- * otherwise returns `IfFalse`. Optionally trims whitespace before checking.
384
- *
385
- * @template T - The string type to check.
386
- * @template IfTrue - Type returned if `T` is non-empty (default `true`).
387
- * @template IfFalse - Type returned if `T` is empty (default `false`).
388
- * @template WithTrim - Whether to trim whitespace before checking (default `true`).
389
- *
390
- * @example
391
- * ```ts
392
- * type Case1 = IfNonEmptyString<"abc">;
393
- * // ➔ true
394
- * type Case2 = IfNonEmptyString<"">;
395
- * // ➔ false
396
- * type Case3 = IfNonEmptyString<"abc", "yes", "no">;
397
- * // ➔ "yes"
398
- * type Case4 = IfNonEmptyString<"", "yes", "no">;
399
- * // ➔ "no"
400
- * type Case5 = IfNonEmptyString<" ", "yes", "no", true>;
401
- * // ➔ "no" (trimmed)
402
- * type Case6 = IfNonEmptyString<" ", "yes", "no", false>;
403
- * // ➔ "yes" (not trimmed)
404
- * ```
405
- */
406
- type IfNonEmptyString<T extends string,IfTrue=true,IfFalse=false,WithTrim extends boolean=true>=IfNot<IsNever<NonEmptyString<T,WithTrim>>,IfTrue,IfFalse>;
407
- /** -------------------------------------------------------
408
58
  * * ***Or.***
409
59
  * -------------------------------------------------------
410
60
  *
@@ -1554,4 +1204,4 @@ type IsMutableArray<T>=And<IsArray<T>,NotExtends<Readonly<T>,T>>;
1554
1204
  * type Case2 = IsReadonlyArray<[]>;
1555
1205
  * // ➔ false
1556
1206
  */
1557
- type IsReadonlyArray<T>=And<IsArray<T>,NotExtends<T,Mutable<T>>>;export type{NegativeFloat as $,And as A,IfFloat as B,CharAt as C,IfInteger as D,Even as E,Float as F,IfNegativeFloat as G,IfNegativeInteger as H,IsStringLiteral as I,IfOdd as J,IfPositiveFloat as K,IfPositiveInteger as L,Mutable as M,Negate as N,Or as O,ParseNumber as P,Integer as Q,Repeat as R,Split as S,Trim as T,IsNegativeFloat as U,IsOdd as V,Whitespace as W,IsPositiveFloat as X,IsPositiveInteger as Y,IsScientificNumber as Z,Negative as _,IsEmptyString as a,NegativeInteger as a0,Odd as a1,OddDigit as a2,ParseScientificNumber as a3,Positive as a4,PositiveFloat as a5,PositiveInteger as a6,EmptyString as a7,IfNonEmptyString as a8,IsNonEmptyString as a9,NonEmptyString as aa,TrimLeft as ab,TrimRight as ac,TrimsLower as ad,TrimsUpper as ae,IfUnknown as af,UnknownifyProperties as ag,UnknownifyPropertiesOptions as ah,IsNegative as b,Abs as c,IsFloat as d,IsUnknown as e,IsNegativeInteger as f,IfEmptyString as g,OrArr as h,AndArr as i,IsInteger as j,Push as k,IfNegative as l,IsPositive as m,IsEven as n,AnyString as o,IsReadonlyArray as p,IfPositive as q,WordSeparator as r,IfNot as s,IsArray as t,IsMutableArray as u,MutableExcept as v,MutableOnly as w,MutableOptions as x,EvenDigit as y,IfEven as z};
1207
+ type IsReadonlyArray<T>=And<IsArray<T>,NotExtends<T,Mutable<T>>>;export type{PositiveInteger as $,And as A,IfPositiveFloat as B,CharAt as C,IfPositiveInteger as D,Even as E,Float as F,Integer as G,IsNegativeFloat as H,IsStringLiteral as I,IsOdd as J,IsPositiveFloat as K,IsPositiveInteger as L,Mutable as M,Negate as N,Or as O,ParseNumber as P,IsScientificNumber as Q,Repeat as R,Split as S,Negative as T,NegativeFloat as U,NegativeInteger as V,Odd as W,OddDigit as X,ParseScientificNumber as Y,Positive as Z,PositiveFloat as _,IsNegative as a,IfUnknown as a0,UnknownifyProperties as a1,UnknownifyPropertiesOptions as a2,Abs as b,IsFloat as c,IsUnknown as d,IsNegativeInteger as e,OrArr as f,AndArr as g,IsInteger as h,Push as i,IfNegative as j,IsPositive as k,IsEven as l,IsReadonlyArray as m,IfPositive as n,IsArray as o,IsMutableArray as p,MutableExcept as q,MutableOnly as r,MutableOptions as s,EvenDigit as t,IfEven as u,IfFloat as v,IfInteger as w,IfNegativeFloat as x,IfNegativeInteger as y,IfOdd as z};
@@ -1,4 +1,6 @@
1
- import{N as NonPlainObject}from'./type-data-DDs-u2kq.js';type GetPreciseTypeOptions={
1
+ import{N as NonPlainObject}from'./type-data-DDs-u2kq.js';
2
+ /** Types for **{@link getPreciseType}**. */
3
+ type GetPreciseTypeOptions={
2
4
  /** -------------------------------------------------------
3
5
  * * ***Specifies the format in which the returned string type should be transformed.***
4
6
  * -------------------------------------------------------
@@ -30,31 +32,28 @@ import{N as NonPlainObject}from'./type-data-DDs-u2kq.js';type GetPreciseTypeOpti
30
32
  */
31
33
  formatCase?:"toPascalCaseSpace"|"toPascalCase"|"toCamelCase"|"toKebabCase"|"toSnakeCase"|"toDotCase"|"slugify"|"toLowerCase";};
32
34
  /** ----------------------------------------------------------
33
- * * ***Returns a detailed and normalized type string for the given value.***
35
+ * * ***Utility-Predicate: `getPreciseType`.***
34
36
  * ----------------------------------------------------------
35
- *
36
- * The returned string is human-readable _**toLowerCase**_ with spaces _***(by default)***_ or
37
- * formatted according to the `options.formatCase` setting.
38
- *
39
- * Handles:
40
- * - Primitives (`string`, `number`, `boolean`, `null`, `undefined`, `symbol`, `bigint`)
41
- * - Built-in objects (`Array`, `Map`, `Set`, `Error subclasses`, `Typed Arrays`, etc)
42
- * - Objects created with `Object.create(null)`
43
- * - Generator instances
44
- * - Node.js `Buffer` instances
45
- * - Proxy detection (returns `"Proxy"` if detected; detection is not 100% accurate)
46
- * - Uses cached mapping table (`FIXES`) for known types to provide consistent naming
47
- * - Falls back to constructor name or `Object.prototype.toString` tag
48
- *
37
+ * **Returns a detailed and normalized type string for the given value.**
38
+ * @description
39
+ * The returned string is human-readable _**toLowerCase**_ with spaces _***(by default)***_ or formatted according to the `options.formatCase` setting.
40
+ * - **Handles:**
41
+ * - Primitives (`string`, `number`, `boolean`, `null`, `undefined`, `symbol`, `bigint`)
42
+ * - Built-in objects (`Array`, `Map`, `Set`, `Error subclasses`, `Typed Arrays`, `etc`)
43
+ * - Objects created with `Object.create(null)`
44
+ * - Generator instances
45
+ * - Node.js `Buffer` instances
46
+ * - Proxy detection (returns `"Proxy"` if detected; detection is not 100% accurate)
47
+ * - Uses cached mapping table (`FIXES`) for known types to provide consistent naming
48
+ * - Falls back to constructor name or `Object.prototype.toString` tag
49
49
  * @param {*} value - The value to detect the precise type of
50
- * @param {Object} [options] - Optional configuration
51
- * @param {"toPascalCaseSpace"|"toLowerCase"|"toPascalCase"|"toCamelCase"|"toKebabCase"|"toSnakeCase"|"toDotCase"|"slugify"} [options.formatCase="toLowerCase"]
52
- * - Specifies how the returned type string should be formatted.
53
- * - ⚠️ Special string literals in `SPECIAL_CASES` (`"-Infinity" | "Infinity" | "NaN"`)
54
- * will remain unchanged even if a different `formatCase` is applied.
55
- *
50
+ * @param {GetPreciseTypeOptions} [options] - Optional configuration
51
+ * @param {GetPreciseTypeOptions["formatCase"]} [options.formatCase="toLowerCase"]
52
+ * Specifies how the returned type string should be formatted.
53
+ * - ⚠️ Special string literals in `SPECIAL_CASES`
54
+ * (`"-Infinity" | "Infinity" | "NaN"`) will remain
55
+ * unchanged even if a different `formatCase` is applied.
56
56
  * @returns {string} The normalized and formatted type string
57
- *
58
57
  * @example
59
58
  * getPreciseType(123); // ➔ "number"
60
59
  * getPreciseType(null); // ➔ "null"
@@ -64,32 +63,30 @@ formatCase?:"toPascalCaseSpace"|"toPascalCase"|"toCamelCase"|"toKebabCase"|"toSn
64
63
  * // ➔ "generatorFunction"
65
64
  * getPreciseType(async function () {}, { formatCase: "toPascalCaseSpace" });
66
65
  * // ➔ "Async Function"
67
- * getPreciseType("NaN", { formatCase: "toKebabCase" });
66
+ * getPreciseType(NaN, { formatCase: "toKebabCase" });
68
67
  * // ➔ "NaN" (SPECIAL_CASES remain)
69
68
  */
70
69
  declare const getPreciseType:(value:unknown,options?:GetPreciseTypeOptions)=>string;type IsNumberOptions={
71
- /**
72
- * If set to `true`, `NaN` will be considered a valid number.
70
+ /** If set to `true`, `NaN` will be considered a valid number, defaultValue: `false`.
71
+ *
73
72
  * @default false
74
73
  */
75
74
  includeNaN?:boolean;};
76
75
  /** ---------------------------------------------------------
77
76
  * * ***Type guard: `isNumber`.***
78
77
  * ----------------------------------------------------------
79
- * @description Checks if a value is of type **`number`**.
80
- *
81
- * - Uses `typeof value === "number"`.
82
- * - By default, excludes **`NaN`**.
83
- * - If `options.includeNaN` is `true`, then **`NaN`** is also considered valid.
84
- * - Still considers `Infinity` and `-Infinity` as numbers (consistent with JavaScript).
85
- *
86
- * ℹ️ To exclude `Infinity` and `-Infinity`, use **{@link isFinite}** instead.
87
- *
78
+ * **Checks if a value is of type **`number`**.**
79
+ * - **Behavior:**
80
+ * - Uses `typeof value === "number"`.
81
+ * - By default, excludes **`NaN`**.
82
+ * - If `options.includeNaN` is `true`, then **`NaN`** is also considered valid.
83
+ * - Still considers `Infinity` and `-Infinity` as **numbers** (consistent with JavaScript).
84
+ * - **ℹ️ Note:**
85
+ * - To exclude `Infinity` and `-Infinity`, use **{@link isFinite | `isFinite`}** instead.
88
86
  * @param {*} value - The value to check.
89
- * @param {IsNumberOptions} options - Optional settings.
90
- * @param {boolean} options.includeNaN If `true`, `NaN` will be considered a valid number, dsefaults to `false`, which excludes `NaN`.
87
+ * @param {IsNumberOptions} [options] - Optional settings.
88
+ * @param {boolean} [options.includeNaN=false] If `true`, `NaN` will be considered a valid number, defaults to `false`, which excludes `NaN`.
91
89
  * @returns {boolean} Returns `true` if the value is a number (and depending on `includeNaN`, `NaN` is included or excluded).
92
- *
93
90
  * @example
94
91
  * isNumber(42);
95
92
  * // ➔ true
@@ -108,18 +105,14 @@ declare const isNumber:(value:unknown,options?:IsNumberOptions)=>value is number
108
105
  /** ----------------------------------------------------------
109
106
  * * ***Utility type: `IsPlainObjectResult`.***
110
107
  * ----------------------------------------------------------
111
- * @description
112
- * Represents the inferred type after asserting a value is a **plain object**.
113
- *
114
-
115
- *
116
- * - If `T` is `unknown`, the resulting type is `Record<PropertyKey, unknown> & T`.
117
- * - If `T` is an object:
118
- * - If it is a non-plain object (class instance, built-in object, etc.), the result is `never`.
119
- * - If it has no keys (`HasKeys<T>` checked by **{@link HasKeys}** is false), the result is `Record<PropertyKey, unknown> & T`.
120
- * - Otherwise, the result is `T` itself.
121
- * - For any other types, the result is `never`.
122
- *
108
+ * **Represents the inferred type after asserting a value is a **plain object**.**
109
+ * - **Behavior:**
110
+ * - If `T` is `unknown`, the resulting type is `Record<PropertyKey, unknown> & T`.
111
+ * - If `T` is an object:
112
+ * - If it is a non-plain object (class instance, built-in object, etc.), the result is `never`.
113
+ * - If it has no keys (`HasKeys<T>` checked by **{@link HasKeys}** is false), the result is `Record<PropertyKey, unknown> & T`.
114
+ * - Otherwise, the result is `T` itself.
115
+ * - For any other types, the result is `never`.
123
116
  * @template T - The input type to be asserted as a plain object.
124
117
  * @example
125
118
  * ```ts
@@ -137,18 +130,14 @@ type IsPlainObjectResult<T>=unknown extends T?Record<PropertyKey,unknown>& T:T e
137
130
  /** ----------------------------------------------------------
138
131
  * * ***Type guard: `isPlainObject`.***
139
132
  * ----------------------------------------------------------
140
- * @description
141
- * Checks if a value is a **plain-object**.
142
- *
143
- * A plain object is:
144
- * - Created by the `Object` constructor, or
145
- * - Has a `[[Prototype]]` of `null` (e.g. `Object.create(null)`).
146
- * ----------------------------------------------------------
147
- * - ✅ Returns `true` for:
133
+ * **Checks if a value is a **plain-object**.**
134
+ * - **A plain object is:**
135
+ * - Created by the `Object` constructor, or
136
+ * - Has a `[[Prototype]]` of `null` (e.g. `Object.create(null)`).
137
+ * - **✅ Returns `true` for:**
148
138
  * - Empty object literals: `{}`
149
139
  * - Objects with null prototype: `Object.create(null)`
150
- * ----------------------------------------------------------
151
- * - ❌ Returns `false` for:
140
+ * - **❌ Returns `false` for:**
152
141
  * - Arrays (`[]`, `new Array()`)
153
142
  * - Functions (regular, arrow, or class constructors)
154
143
  * - Built-in objects: `Date`, `RegExp`, `Error`, `Map`, `Set`, `WeakMap`, `WeakSet`
@@ -156,11 +145,9 @@ type IsPlainObjectResult<T>=unknown extends T?Record<PropertyKey,unknown>& T:T e
156
145
  * - `null` or `undefined`
157
146
  * - Symbols
158
147
  * - Class instances
159
- *
160
148
  * @template T - The type of the value being checked.
161
149
  * @param {*} value - The value to check.
162
150
  * @returns {boolean} Return `true` if `value` is a `plain-object`, otherwise `false`.
163
- *
164
151
  * @example
165
152
  * isPlainObject({});
166
153
  * // ➔ true
@@ -1,8 +1,8 @@
1
- 'use strict';var chunk5JFV3GDE_cjs=require('../chunk-5JFV3GDE.cjs'),chunkN2IJPIND_cjs=require('../chunk-N2IJPIND.cjs'),chunk2TRAPBZ7_cjs=require('../chunk-2TRAPBZ7.cjs'),chunkBVPMMWDL_cjs=require('../chunk-BVPMMWDL.cjs');require('../chunk-PUQXRLZH.cjs');var chunkU5Y2FXMN_cjs=require('../chunk-U5Y2FXMN.cjs');require('../chunk-7YWAQOA4.cjs');var chunkCN53M4QZ_cjs=require('../chunk-CN53M4QZ.cjs');function C(e,t){if(!chunkCN53M4QZ_cjs.h(e)||chunk2TRAPBZ7_cjs.a(e))throw new TypeError(`\u274C 'generateRoute' Failed:
1
+ 'use strict';var chunkO5VXBNUQ_cjs=require('../chunk-O5VXBNUQ.cjs'),chunk445TAVT4_cjs=require('../chunk-445TAVT4.cjs'),chunk6Q4I2RPC_cjs=require('../chunk-6Q4I2RPC.cjs'),chunkDYRDBYPF_cjs=require('../chunk-DYRDBYPF.cjs');require('../chunk-PUQXRLZH.cjs');var chunkO7SJR4CY_cjs=require('../chunk-O7SJR4CY.cjs');require('../chunk-7YWAQOA4.cjs');var chunkLVUSFXQS_cjs=require('../chunk-LVUSFXQS.cjs');function N(e,t){if(!chunkLVUSFXQS_cjs.g(e)||chunk6Q4I2RPC_cjs.a(e))throw new TypeError(`\u274C 'generateRoute' Failed:
2
2
  - Invalid 'route' value.
3
- - Must be of type \`string\` and non-empty string, but received: "${chunkCN53M4QZ_cjs.E(e)}": \`${chunkU5Y2FXMN_cjs.c(e)}\`.`);if(!/[\\[\]]/.test(e))return e;if(chunkCN53M4QZ_cjs.m(t,{message:({validType:o})=>`\u274C 'generateRoute' Failed cause in route "${e}":
4
- - Missing or invalid parameters \`${o}\` for route: "${e}", must be of type \`${o}\` mapping parameters.`}),chunkCN53M4QZ_cjs.c(t))throw new TypeError(`\u274C 'generateRoute' Failed cause in route "${e}":
5
- - Missing parameters \`plain-object\` for route: "${e}".`);let n=["?","&","#","=","/","'",'"',"(",")","+",";","%","@",":"],r=[],s=Array.from(e.matchAll(/\[(\w+)\]/g)).map(o=>o[1]);for(let o of s){let i=t[o];if(!chunkCN53M4QZ_cjs.h(i)){r.push(`- Invalid parameter: "${o}" must be of type \`string\`, but received: \`${chunkCN53M4QZ_cjs.E(i)}\`.`);continue}if(chunk2TRAPBZ7_cjs.a(i)){r.push(`- Parameter "${o}" cannot be empty string.`);continue}let p=n.filter(g=>i.includes(g));if(/\s/.test(i)&&p.push("white-space(s)"),p.length>0){let g=p.map(a=>a==="`"?"backtick - (`)":`\`${a}\``);n.includes("white-space(s)")||n.push("white-space(s)");let c=n.map(a=>a==="`"?"backtick - (`)":`\`${a}\``);r.push(`- Parameter "${o}" contains invalid characters (${g.join(", ")}). These characters are not allowed because they could cause issues in URL structure. The following characters are forbidden in route parameters: (${c.join(", ")}).`);}}if(chunkCN53M4QZ_cjs.r(r))throw new Error(`\u274C 'generateRoute' Failed cause in route "${e}":
3
+ - Must be of type \`string\` and non-empty string, but received: "${chunkLVUSFXQS_cjs.E(e)}": \`${chunkO7SJR4CY_cjs.c(e)}\`.`);if(!/[\\[\]]/.test(e))return e;if(chunkLVUSFXQS_cjs.j(t,{message:({validType:o})=>`\u274C 'generateRoute' Failed cause in route "${e}":
4
+ - Missing or invalid parameters \`${o}\` for route: "${e}", must be of type \`${o}\` mapping parameters.`}),chunkLVUSFXQS_cjs.c(t))throw new TypeError(`\u274C 'generateRoute' Failed cause in route "${e}":
5
+ - Missing parameters \`plain-object\` for route: "${e}".`);let n=["?","&","#","=","/","'",'"',"(",")","+",";","%","@",":"],r=[],s=Array.from(e.matchAll(/\[(\w+)\]/g)).map(o=>o[1]);for(let o of s){let i=t[o];if(!chunkLVUSFXQS_cjs.g(i)){r.push(`- Invalid parameter: "${o}" must be of type \`string\`, but received: \`${chunkLVUSFXQS_cjs.E(i)}\`.`);continue}if(chunk6Q4I2RPC_cjs.a(i)){r.push(`- Parameter "${o}" cannot be empty string.`);continue}let p=n.filter(g=>i.includes(g));if(/\s/.test(i)&&p.push("white-space(s)"),p.length>0){let g=p.map(a=>a==="`"?"backtick - (`)":`\`${a}\``);n.includes("white-space(s)")||n.push("white-space(s)");let m=n.map(a=>a==="`"?"backtick - (`)":`\`${a}\``);r.push(`- Parameter "${o}" contains invalid characters (${g.join(", ")}). These characters are not allowed because they could cause issues in URL structure. The following characters are forbidden in route parameters: (${m.join(", ")}).`);}}if(chunkLVUSFXQS_cjs.r(r))throw new Error(`\u274C 'generateRoute' Failed cause in route "${e}":
6
6
  ${r.join(`
7
- `)}.`);return e.replace(/\[(\w+)\]/g,(o,i)=>(chunkCN53M4QZ_cjs.p(t[i])?t[i]:"").trim().replace(/^\/+|\/+$/g,"")).replace(/\/+/g,"/")}var M=(e="",t)=>{try{let p=function(c,a){return `${c.replace(/\/+$/,"")}/${a.replace(/^\/+/,"")}`};var n=p;chunkBVPMMWDL_cjs.a(e,{message({currentType:c,validType:a}){return `First parameter \`pathname\` must be of type \`${a}\`, but received: \`${c}\`.`}}),chunkCN53M4QZ_cjs.f(t)||(t={});let{prefix:r="/api",withOrigin:s=!0}=t;if(!chunkCN53M4QZ_cjs.k(r)&&!chunkCN53M4QZ_cjs.h(r))throw new TypeError(`Parameter \`prefix\` property of the \`options\` (second parameter) must be of type \`string\`, but received: ${chunkCN53M4QZ_cjs.E(r)}.`);chunkCN53M4QZ_cjs.G(s,{message:({currentType:c,validType:a})=>`Parameter \`withOrigin\` property of the \`options\` (second parameter) must be of type \`${a}\`, but received: \`${c}\`.`}),e=chunk5JFV3GDE_cjs.c(e),r=chunk5JFV3GDE_cjs.c(r);let o=r.endsWith("/")?r:r+"/";(e===r||e===r+"/"||e.startsWith(o))&&(e=e.slice(r.length),e=chunk5JFV3GDE_cjs.c(e));let i=U({suffix:r});return p(s?i:new URL(i).pathname,e).replace(/\/+$/,"")}catch(r){throw new Error("Failed to generate backend API URL in `createBeApiUrl()`, Error:"+r)}};var U=({suffix:e="/"}={})=>{chunkBVPMMWDL_cjs.a(e,{message({currentType:t,validType:n}){return `Parameter \`suffix\` property of the first parameter must be of type \`${n}\`, but received: \`${t}\`.`}});try{let t=process.env.NEXT_PUBLIC_BACKEND_API_URL?.trim();if(t){t=chunkN2IJPIND_cjs.c(t);let s=new URL(t);!!!s.port&&process.env.NEXT_PUBLIC_PORT_BE&&(t=s.origin+chunk5JFV3GDE_cjs.d(process.env.NEXT_PUBLIC_PORT_BE,{prefixColon:!0}));}else t="http://localhost"+chunk5JFV3GDE_cjs.d(process.env.NEXT_PUBLIC_PORT_BE||"8000",{prefixColon:!0});e=chunkN2IJPIND_cjs.c(e).length?chunkN2IJPIND_cjs.c(e):"/";let n=new URL(t.replace(/\/+$/,"")).origin,r=e==="/"?"/":`${e.startsWith("/")?"":"/"}${e.replace(/\/+$/,"")}`;return `${n}${r}`}catch(t){throw new Error("Invalid `NEXT_PUBLIC_BACKEND_API_URL`, failed to generate from `getBeApiUrl()`, Error:"+t)}};var Z=()=>{try{let e=process.env.NEXT_PUBLIC_BASE_URL?.trim(),t=process.env.NEXT_PUBLIC_PORT_FE?.trim(),n=e||"http://localhost";n=chunkN2IJPIND_cjs.c(n).replace(/\/+$/,"");let r=/:\/\/[^/]+:\d+/.test(n);!r&&t?n+=chunk5JFV3GDE_cjs.d(t,{prefixColon:!0}):!r&&!e&&(n+=":3000");let s=new URL(n);return `${s.protocol}//${s.hostname}${s.port?`:${s.port}`:""}`}catch(e){throw new Error("Invalid `NEXT_PUBLIC_BASE_URL`, failed to generate from `getBaseUrl()`, Error:"+e)}};
8
- exports.createBeApiUrl=M;exports.generateRoute=C;exports.getBaseUrl=Z;exports.getBeApiUrl=U;
7
+ `)}.`);return e.replace(/\[(\w+)\]/g,(o,i)=>(chunkLVUSFXQS_cjs.p(t[i])?t[i]:"").trim().replace(/^\/+|\/+$/g,"")).replace(/\/+/g,"/")}var q=(e,t={})=>{try{let p=function(m,a){return `${m.replace(/\/+$/,"")}/${a.replace(/^\/+/,"")}`};var n=p;chunkDYRDBYPF_cjs.a(chunkLVUSFXQS_cjs.c(e)?"":e,{message({currentType:m,validType:a}){return `First parameter (\`pathname\`) must be of type \`${a}\`, but received: \`${m}\`.`}}),chunkLVUSFXQS_cjs.f(t)||(t={});let{prefix:r="/api",withOrigin:s=!0}=t;if(!chunkLVUSFXQS_cjs.m(r)&&!chunkLVUSFXQS_cjs.g(r))throw new TypeError(`Parameter \`prefix\` property of the \`options\` (second parameter) must be of type \`string\`, but received: \`${chunkLVUSFXQS_cjs.E(r)}\`.`);chunkLVUSFXQS_cjs.G(s,{message:({currentType:m,validType:a})=>`Parameter \`withOrigin\` property of the \`options\` (second parameter) must be of type \`${a}\`, but received: \`${m}\`.`}),e=chunkO5VXBNUQ_cjs.c(e),r=chunkO5VXBNUQ_cjs.c(r);let o=r.endsWith("/")?r:r+"/";(e===r||e===r+"/"||e.startsWith(o))&&(e=e.slice(r.length),e=chunkO5VXBNUQ_cjs.c(e));let i=b({suffix:r});return p(s?i:new URL(i).pathname,e).replace(/\/+$/,"")}catch(r){throw chunkLVUSFXQS_cjs.C(r)?r:new Error("Failed to generate backend API URL in `createBeApiUrl()`, Error: "+new Error(String(r)).message.trim())}};var b=({suffix:e="/"}={})=>{chunkDYRDBYPF_cjs.a(e,{message({currentType:t,validType:n}){return `Parameter \`suffix\` property of the first parameter must be of type \`${n}\`, but received: \`${t}\`.`}});try{let t=process.env.NEXT_PUBLIC_BACKEND_API_URL?.trim();if(t){t=chunk445TAVT4_cjs.c(t);let s=new URL(t);!!!s.port&&process.env.NEXT_PUBLIC_PORT_BE&&(t=s.origin+chunkO5VXBNUQ_cjs.d(process.env.NEXT_PUBLIC_PORT_BE,{prefixColon:!0}));}else t="http://localhost"+chunkO5VXBNUQ_cjs.d(process.env.NEXT_PUBLIC_PORT_BE||"8000",{prefixColon:!0});e=chunk445TAVT4_cjs.c(e).length?chunk445TAVT4_cjs.c(e):"/";let n=new URL(t.replace(/\/+$/,"")).origin,r=e==="/"?"/":`${e.startsWith("/")?"":"/"}${e.replace(/\/+$/,"")}`;return `${n}${r}`}catch(t){throw new Error("Invalid `NEXT_PUBLIC_BACKEND_API_URL`, failed to generate from `getBeApiUrl()`, Error:"+t)}};var te=()=>{try{let e=process.env.NEXT_PUBLIC_BASE_URL?.trim(),t=process.env.NEXT_PUBLIC_PORT_FE?.trim(),n=e||"http://localhost";n=chunk445TAVT4_cjs.c(n).replace(/\/+$/,"");let r=/:\/\/[^/]+:\d+/.test(n);!r&&t?n+=chunkO5VXBNUQ_cjs.d(t,{prefixColon:!0}):!r&&!e&&(n+=":3000");let s=new URL(n);return `${s.protocol}//${s.hostname}${s.port?`:${s.port}`:""}`}catch(e){throw new Error("Invalid `NEXT_PUBLIC_BASE_URL`, failed to generate from `getBaseUrl()`, Error:"+e)}};
8
+ exports.createBeApiUrl=q;exports.generateRoute=N;exports.getBaseUrl=te;exports.getBeApiUrl=b;