@catbee/utils 2.0.0-next.0 → 2.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 (122) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +102 -52
  3. package/array/index.cjs +215 -74
  4. package/array/index.d.ts +345 -2
  5. package/array/index.mjs +201 -74
  6. package/async/index.cjs +116 -39
  7. package/async/index.d.ts +292 -2
  8. package/async/index.mjs +116 -40
  9. package/cache/index.cjs +2 -2
  10. package/cache/index.d.ts +156 -2
  11. package/cache/index.mjs +3 -3
  12. package/config/index.cjs +80 -66
  13. package/config/index.d.ts +65 -3
  14. package/config/index.mjs +77 -65
  15. package/context-store/index.cjs +2 -3
  16. package/context-store/index.d.ts +193 -2
  17. package/context-store/index.mjs +2 -3
  18. package/crypto/index.cjs +55 -5
  19. package/crypto/index.d.ts +225 -2
  20. package/crypto/index.mjs +52 -7
  21. package/date/index.cjs +676 -2
  22. package/date/index.d.ts +676 -2
  23. package/date/index.mjs +665 -3
  24. package/decorator/index.cjs +2172 -0
  25. package/{decorators/decorators.utils.d.ts → decorator/index.d.ts} +58 -54
  26. package/decorator/index.mjs +2131 -0
  27. package/{dir → directory}/index.cjs +5 -4
  28. package/{dir/dir.utils.d.ts → directory/index.d.ts} +24 -21
  29. package/{dir → directory}/index.mjs +5 -4
  30. package/env/index.cjs +100 -68
  31. package/env/index.d.ts +391 -2
  32. package/env/index.mjs +100 -68
  33. package/exception/index.cjs +1 -1
  34. package/exception/index.d.ts +233 -2
  35. package/exception/index.mjs +1 -1
  36. package/fs/index.cjs +71 -37
  37. package/fs/index.d.ts +206 -2
  38. package/fs/index.mjs +65 -35
  39. package/http-status-codes/index.cjs +1 -1
  40. package/http-status-codes/index.d.ts +268 -2
  41. package/http-status-codes/index.mjs +1 -1
  42. package/id/index.cjs +1 -1
  43. package/id/index.d.ts +38 -2
  44. package/id/index.mjs +1 -1
  45. package/index.cjs +13 -13
  46. package/index.d.ts +5 -5
  47. package/index.mjs +5 -5
  48. package/logger/index.cjs +13 -15
  49. package/logger/index.d.ts +190 -2
  50. package/logger/index.mjs +14 -16
  51. package/middleware/index.cjs +1 -1
  52. package/middleware/index.d.ts +104 -2
  53. package/middleware/index.mjs +1 -1
  54. package/object/index.cjs +379 -0
  55. package/{obj/obj.utils.d.ts → object/index.d.ts} +73 -33
  56. package/object/index.mjs +360 -0
  57. package/package.json +41 -23
  58. package/performance/index.cjs +4 -4
  59. package/performance/index.d.ts +139 -2
  60. package/performance/index.mjs +4 -4
  61. package/request/index.cjs +37 -25
  62. package/request/index.d.ts +242 -3
  63. package/request/index.mjs +37 -25
  64. package/response/index.cjs +1 -1
  65. package/response/index.d.ts +319 -3
  66. package/response/index.mjs +1 -1
  67. package/server/index.cjs +249 -146
  68. package/server/index.d.ts +866 -5
  69. package/server/index.mjs +248 -144
  70. package/stream/index.cjs +1 -1
  71. package/stream/index.d.ts +91 -2
  72. package/stream/index.mjs +1 -1
  73. package/string/index.cjs +34 -1
  74. package/string/index.d.ts +146 -2
  75. package/string/index.mjs +31 -2
  76. package/type/index.cjs +19 -2
  77. package/type/index.d.ts +144 -2
  78. package/type/index.mjs +17 -3
  79. package/types/index.cjs +1 -1
  80. package/types/index.d.ts +775 -5
  81. package/types/index.mjs +1 -1
  82. package/url/index.cjs +63 -5
  83. package/url/index.d.ts +200 -2
  84. package/url/index.mjs +59 -6
  85. package/{validate → validation}/index.cjs +91 -44
  86. package/{validate/validate.utils.d.ts → validation/index.d.ts} +33 -24
  87. package/{validate → validation}/index.mjs +87 -44
  88. package/array/array.utils.d.ts +0 -191
  89. package/async/async.utils.d.ts +0 -296
  90. package/cache/cache.utils.d.ts +0 -176
  91. package/config/config.d.ts +0 -57
  92. package/context-store/context-store.utils.d.ts +0 -212
  93. package/crypto/crypto.utils.d.ts +0 -183
  94. package/date/date.utils.d.ts +0 -190
  95. package/decorators/index.cjs +0 -913
  96. package/decorators/index.d.ts +0 -25
  97. package/decorators/index.mjs +0 -872
  98. package/dir/index.d.ts +0 -25
  99. package/env/env.utils.d.ts +0 -400
  100. package/exception/exception.utils.d.ts +0 -253
  101. package/fs/fs.utils.d.ts +0 -196
  102. package/http-status-codes/http-status-codes.d.ts +0 -289
  103. package/id/id.utils.d.ts +0 -59
  104. package/logger/logger.utils.d.ts +0 -210
  105. package/middleware/middleware.utils.d.ts +0 -123
  106. package/obj/index.cjs +0 -317
  107. package/obj/index.d.ts +0 -25
  108. package/obj/index.mjs +0 -301
  109. package/performance/performance.utils.d.ts +0 -159
  110. package/request/request.utils.d.ts +0 -109
  111. package/response/response.utils.d.ts +0 -186
  112. package/server/server.builder.d.ts +0 -531
  113. package/server/server.d.ts +0 -303
  114. package/stream/stream.utils.d.ts +0 -111
  115. package/string/string.utils.d.ts +0 -124
  116. package/type/type.utils.d.ts +0 -129
  117. package/types/api-response.d.ts +0 -175
  118. package/types/common.d.ts +0 -148
  119. package/types/config.d.ts +0 -88
  120. package/types/server.d.ts +0 -291
  121. package/url/url.utils.d.ts +0 -164
  122. package/validate/index.d.ts +0 -25
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
@@ -22,4 +22,270 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- export * from './http-status-codes';
25
+ /**
26
+ * Complete HTTP status codes enum with descriptions.
27
+ * For use with API responses and error handling.
28
+ */
29
+ declare enum HttpStatusCodes {
30
+ /**
31
+ * The server has received the request headers and the client should proceed to send the request body.
32
+ */
33
+ CONTINUE = 100,
34
+ /**
35
+ * The server is switching protocols according to the client's request.
36
+ */
37
+ SWITCHING_PROTOCOLS = 101,
38
+ /**
39
+ * Server has received the request and is still processing it.
40
+ */
41
+ PROCESSING = 102,
42
+ /**
43
+ * The server is sending preliminary headers while preparing the final response.
44
+ */
45
+ EARLY_HINTS = 103,
46
+ /**
47
+ * The request succeeded. The result meaning depends on the HTTP method used.
48
+ */
49
+ OK = 200,
50
+ /**
51
+ * The request succeeded and a new resource was created as a result.
52
+ */
53
+ CREATED = 201,
54
+ /**
55
+ * The request has been received but not yet acted upon.
56
+ */
57
+ ACCEPTED = 202,
58
+ /**
59
+ * The returned information is from a third-party source, not the origin server.
60
+ */
61
+ NON_AUTHORITATIVE_INFORMATION = 203,
62
+ /**
63
+ * The request succeeded but there's no content to send in the response.
64
+ */
65
+ NO_CONTENT = 204,
66
+ /**
67
+ * The client should reset the document view that caused this request.
68
+ */
69
+ RESET_CONTENT = 205,
70
+ /**
71
+ * The server is delivering only part of the resource due to a range header sent by the client.
72
+ */
73
+ PARTIAL_CONTENT = 206,
74
+ /**
75
+ * Conveys information about multiple resources, for complex operations.
76
+ */
77
+ MULTI_STATUS = 207,
78
+ /**
79
+ * The members of a DAV binding have already been enumerated and are not included in the response.
80
+ */
81
+ ALREADY_REPORTED = 208,
82
+ /**
83
+ * The server has fulfilled a request for the resource, and the response represents the result of one or more instance-manipulations.
84
+ */
85
+ IM_USED = 226,
86
+ /**
87
+ * The request has more than one possible response and the client should choose one.
88
+ */
89
+ MULTIPLE_CHOICES = 300,
90
+ /**
91
+ * The resource has been permanently moved to a new URL.
92
+ */
93
+ MOVED_PERMANENTLY = 301,
94
+ /**
95
+ * The resource has been temporarily moved to another URL.
96
+ */
97
+ MOVED_TEMPORARILY = 302,
98
+ /**
99
+ * The response to the request can be found under another URI using the GET method.
100
+ */
101
+ SEE_OTHER = 303,
102
+ /**
103
+ * The resource hasn't been modified since the last request.
104
+ */
105
+ NOT_MODIFIED = 304,
106
+ /**
107
+ * @deprecated
108
+ * Response must be accessed through a proxy.
109
+ */
110
+ USE_PROXY = 305,
111
+ /**
112
+ * The resource is temporarily available at a different URI, using the same HTTP method.
113
+ */
114
+ TEMPORARY_REDIRECT = 307,
115
+ /**
116
+ * The resource has been permanently moved to another URL, using the same HTTP method.
117
+ */
118
+ PERMANENT_REDIRECT = 308,
119
+ /**
120
+ * The server cannot process the request due to a client error (malformed request).
121
+ */
122
+ BAD_REQUEST = 400,
123
+ /**
124
+ * Authentication is required and has failed or not been provided.
125
+ */
126
+ UNAUTHORIZED = 401,
127
+ /**
128
+ * Reserved for future use, originally intended for digital payment systems.
129
+ */
130
+ PAYMENT_REQUIRED = 402,
131
+ /**
132
+ * The client doesn't have permission to access the requested resource.
133
+ */
134
+ FORBIDDEN = 403,
135
+ /**
136
+ * The requested resource could not be found on the server.
137
+ */
138
+ NOT_FOUND = 404,
139
+ /**
140
+ * The request method is not supported for the requested resource.
141
+ */
142
+ METHOD_NOT_ALLOWED = 405,
143
+ /**
144
+ * The server can't provide a response matching the list of acceptable values in the client's headers.
145
+ */
146
+ NOT_ACCEPTABLE = 406,
147
+ /**
148
+ * Authentication by a proxy is required.
149
+ */
150
+ PROXY_AUTHENTICATION_REQUIRED = 407,
151
+ /**
152
+ * The server timed out waiting for the request.
153
+ */
154
+ REQUEST_TIMEOUT = 408,
155
+ /**
156
+ * The request conflicts with the current state of the server.
157
+ */
158
+ CONFLICT = 409,
159
+ /**
160
+ * The resource has been permanently deleted with no forwarding address.
161
+ */
162
+ GONE = 410,
163
+ /**
164
+ * The server requires a Content-Length header field.
165
+ */
166
+ LENGTH_REQUIRED = 411,
167
+ /**
168
+ * Preconditions in the client's headers failed.
169
+ */
170
+ PRECONDITION_FAILED = 412,
171
+ /**
172
+ * Request entity is larger than limits defined by server.
173
+ */
174
+ REQUEST_TOO_LONG = 413,
175
+ /**
176
+ * The request payload exceeds server size limits.
177
+ * Modern equivalent of REQUEST_TOO_LONG.
178
+ */
179
+ PAYLOAD_TOO_LARGE = 413,
180
+ /**
181
+ * The URI requested is too long for the server to interpret.
182
+ */
183
+ REQUEST_URI_TOO_LONG = 414,
184
+ /**
185
+ * The server does not support the media type requested by the client.
186
+ */
187
+ UNSUPPORTED_MEDIA_TYPE = 415,
188
+ /**
189
+ * The range specified by the Range header cannot be fulfilled.
190
+ */
191
+ REQUESTED_RANGE_NOT_SATISFIABLE = 416,
192
+ /**
193
+ * The server cannot meet the expectations given in the Expect header.
194
+ */
195
+ EXPECTATION_FAILED = 417,
196
+ /**
197
+ * The server refuses to brew coffee because it is a teapot. (April Fools' joke)
198
+ */
199
+ IM_A_TEAPOT = 418,
200
+ /**
201
+ * The server cannot store the representation needed to complete the request.
202
+ */
203
+ INSUFFICIENT_SPACE_ON_RESOURCE = 419,
204
+ /**
205
+ * @deprecated
206
+ * A method has failed - specific to Spring Framework.
207
+ */
208
+ METHOD_FAILURE = 420,
209
+ /**
210
+ * The server cannot produce a response for the requested URI scheme and authority.
211
+ */
212
+ MISDIRECTED_REQUEST = 421,
213
+ /**
214
+ * The request was well-formed but has semantic errors preventing processing.
215
+ */
216
+ UNPROCESSABLE_ENTITY = 422,
217
+ /**
218
+ * The requested resource is locked against access.
219
+ */
220
+ LOCKED = 423,
221
+ /**
222
+ * The request failed due to the failure of a previous request.
223
+ */
224
+ FAILED_DEPENDENCY = 424,
225
+ /**
226
+ * The client should switch to a different protocol.
227
+ */
228
+ UPGRADE_REQUIRED = 426,
229
+ /**
230
+ * The server requires conditional requests to prevent lost updates.
231
+ */
232
+ PRECONDITION_REQUIRED = 428,
233
+ /**
234
+ * The client has sent too many requests in a given time period (rate limiting).
235
+ */
236
+ TOO_MANY_REQUESTS = 429,
237
+ /**
238
+ * Request headers are too large for the server to process.
239
+ */
240
+ REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
241
+ /**
242
+ * Resource cannot be legally provided (e.g., censored by government).
243
+ */
244
+ UNAVAILABLE_FOR_LEGAL_REASONS = 451,
245
+ /**
246
+ * The server encountered an unexpected error preventing it from fulfilling the request.
247
+ */
248
+ INTERNAL_SERVER_ERROR = 500,
249
+ /**
250
+ * The server does not support the functionality required to fulfill the request.
251
+ */
252
+ NOT_IMPLEMENTED = 501,
253
+ /**
254
+ * The server, acting as a gateway, received an invalid response from an upstream server.
255
+ */
256
+ BAD_GATEWAY = 502,
257
+ /**
258
+ * The server is currently unable to handle the request due to temporary overload or maintenance.
259
+ */
260
+ SERVICE_UNAVAILABLE = 503,
261
+ /**
262
+ * The server, acting as a gateway, did not receive a timely response from an upstream server.
263
+ */
264
+ GATEWAY_TIMEOUT = 504,
265
+ /**
266
+ * The server does not support the HTTP protocol version used in the request.
267
+ */
268
+ HTTP_VERSION_NOT_SUPPORTED = 505,
269
+ /**
270
+ * Transparent content negotiation for the request resulted in circular reference.
271
+ */
272
+ VARIANT_ALSO_NEGOTIATES = 506,
273
+ /**
274
+ * The server cannot store the representation needed to complete the request.
275
+ */
276
+ INSUFFICIENT_STORAGE = 507,
277
+ /**
278
+ * The server detected an infinite loop while processing the request.
279
+ */
280
+ LOOP_DETECTED = 508,
281
+ /**
282
+ * Further extensions to the request are required for the server to fulfill it.
283
+ */
284
+ NOT_EXTENDED = 510,
285
+ /**
286
+ * The client needs to authenticate to gain network access.
287
+ */
288
+ NETWORK_AUTHENTICATION_REQUIRED = 511
289
+ }
290
+
291
+ export { HttpStatusCodes };
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
package/id/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
package/id/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
@@ -22,4 +22,40 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- export * from './id.utils';
25
+ /**
26
+ * Generates a UUID v4 string (RFC 4122).
27
+ *
28
+ * @returns {string} UUID v4 (e.g., 'c0de1234-5678-9abc-def0-123456789abc')
29
+ */
30
+ declare function uuid(): string;
31
+ /**
32
+ * Generates a nanoid-style random ID (URL-safe, customizable length).
33
+ *
34
+ * @param {number} length - Length of the ID (default: 21).
35
+ * @returns {string} Nanoid-style random string.
36
+ */
37
+ declare function nanoId(length?: number): string;
38
+ /**
39
+ * Generates a cryptographically strong random hex string.
40
+ *
41
+ * @param {number} byteLength - Number of random bytes (default: 16 -> 32 hex chars).
42
+ * @returns {string} Random hex string.
43
+ */
44
+ declare function randomHex(byteLength?: number): string;
45
+ /**
46
+ * Generates a random integer between min (inclusive) and max (inclusive).
47
+ *
48
+ * @param {number} min - Minimum value.
49
+ * @param {number} max - Maximum value.
50
+ * @returns {number} Random integer in range.
51
+ */
52
+ declare function randomInt(min: number, max: number): number;
53
+ /**
54
+ * Generates a cryptographically strong random base64 string.
55
+ *
56
+ * @param {number} byteLength - Number of random bytes (default: 16).
57
+ * @returns {string} Random base64 string (URL-safe, no padding).
58
+ */
59
+ declare function randomBase64(byteLength?: number): string;
60
+
61
+ export { nanoId, randomBase64, randomHex, randomInt, uuid };
package/id/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
package/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
@@ -33,8 +33,8 @@ var cache = require("./cache/index.cjs");
33
33
  var contextStore = require("./context-store/index.cjs");
34
34
  var crypto = require("./crypto/index.cjs");
35
35
  var date = require("./date/index.cjs");
36
- var decorators = require("./decorators/index.cjs");
37
- var dir = require("./dir/index.cjs");
36
+ var decorator = require("./decorator/index.cjs");
37
+ var directory = require("./directory/index.cjs");
38
38
  var env = require("./env/index.cjs");
39
39
  var exception = require("./exception/index.cjs");
40
40
  var fs = require("./fs/index.cjs");
@@ -42,7 +42,7 @@ var httpStatusCodes = require("./http-status-codes/index.cjs");
42
42
  var id = require("./id/index.cjs");
43
43
  var logger = require("./logger/index.cjs");
44
44
  var middleware = require("./middleware/index.cjs");
45
- var obj = require("./obj/index.cjs");
45
+ var object = require("./object/index.cjs");
46
46
  var performance = require("./performance/index.cjs");
47
47
  var request = require("./request/index.cjs");
48
48
  var response = require("./response/index.cjs");
@@ -50,7 +50,7 @@ var stream = require("./stream/index.cjs");
50
50
  var string = require("./string/index.cjs");
51
51
  var type = require("./type/index.cjs");
52
52
  var url = require("./url/index.cjs");
53
- var validate = require("./validate/index.cjs");
53
+ var validation = require("./validation/index.cjs");
54
54
 
55
55
 
56
56
 
@@ -108,16 +108,16 @@ Object.keys(date).forEach(function (k) {
108
108
  get: function () { return date[k]; }
109
109
  });
110
110
  });
111
- Object.keys(decorators).forEach(function (k) {
111
+ Object.keys(decorator).forEach(function (k) {
112
112
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
113
113
  enumerable: true,
114
- get: function () { return decorators[k]; }
114
+ get: function () { return decorator[k]; }
115
115
  });
116
116
  });
117
- Object.keys(dir).forEach(function (k) {
117
+ Object.keys(directory).forEach(function (k) {
118
118
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
119
119
  enumerable: true,
120
- get: function () { return dir[k]; }
120
+ get: function () { return directory[k]; }
121
121
  });
122
122
  });
123
123
  Object.keys(env).forEach(function (k) {
@@ -162,10 +162,10 @@ Object.keys(middleware).forEach(function (k) {
162
162
  get: function () { return middleware[k]; }
163
163
  });
164
164
  });
165
- Object.keys(obj).forEach(function (k) {
165
+ Object.keys(object).forEach(function (k) {
166
166
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
167
167
  enumerable: true,
168
- get: function () { return obj[k]; }
168
+ get: function () { return object[k]; }
169
169
  });
170
170
  });
171
171
  Object.keys(performance).forEach(function (k) {
@@ -210,9 +210,9 @@ Object.keys(url).forEach(function (k) {
210
210
  get: function () { return url[k]; }
211
211
  });
212
212
  });
213
- Object.keys(validate).forEach(function (k) {
213
+ Object.keys(validation).forEach(function (k) {
214
214
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
215
215
  enumerable: true,
216
- get: function () { return validate[k]; }
216
+ get: function () { return validation[k]; }
217
217
  });
218
218
  });
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
@@ -31,8 +31,8 @@ export * from './cache';
31
31
  export * from './context-store';
32
32
  export * from './crypto';
33
33
  export * from './date';
34
- export * from './decorators';
35
- export * from './dir';
34
+ export * from './decorator';
35
+ export * from './directory';
36
36
  export * from './env';
37
37
  export * from './exception';
38
38
  export * from './fs';
@@ -40,7 +40,7 @@ export * from './http-status-codes';
40
40
  export * from './id';
41
41
  export * from './logger';
42
42
  export * from './middleware';
43
- export * from './obj';
43
+ export * from './object';
44
44
  export * from './performance';
45
45
  export * from './request';
46
46
  export * from './response';
@@ -48,4 +48,4 @@ export * from './stream';
48
48
  export * from './string';
49
49
  export * from './type';
50
50
  export * from './url';
51
- export * from './validate';
51
+ export * from './validation';
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
@@ -31,8 +31,8 @@ export * from "./cache/index.mjs";
31
31
  export * from "./context-store/index.mjs";
32
32
  export * from "./crypto/index.mjs";
33
33
  export * from "./date/index.mjs";
34
- export * from "./decorators/index.mjs";
35
- export * from "./dir/index.mjs";
34
+ export * from "./decorator/index.mjs";
35
+ export * from "./directory/index.mjs";
36
36
  export * from "./env/index.mjs";
37
37
  export * from "./exception/index.mjs";
38
38
  export * from "./fs/index.mjs";
@@ -40,7 +40,7 @@ export * from "./http-status-codes/index.mjs";
40
40
  export * from "./id/index.mjs";
41
41
  export * from "./logger/index.mjs";
42
42
  export * from "./middleware/index.mjs";
43
- export * from "./obj/index.mjs";
43
+ export * from "./object/index.mjs";
44
44
  export * from "./performance/index.mjs";
45
45
  export * from "./request/index.mjs";
46
46
  export * from "./response/index.mjs";
@@ -48,4 +48,4 @@ export * from "./stream/index.mjs";
48
48
  export * from "./string/index.mjs";
49
49
  export * from "./type/index.mjs";
50
50
  export * from "./url/index.mjs";
51
- export * from "./validate/index.mjs";
51
+ export * from "./validation/index.mjs";
package/logger/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
@@ -133,9 +133,7 @@ function addRedactFields(fields) {
133
133
  __name(addRedactFields, "addRedactFields");
134
134
  var cachedExpandedFields = null;
135
135
  function getExpandedSensitiveFields() {
136
- if (!cachedExpandedFields) {
137
- cachedExpandedFields = expandSensitiveFields(defaultSensitiveFields);
138
- }
136
+ cachedExpandedFields ??= expandSensitiveFields(defaultSensitiveFields);
139
137
  return cachedExpandedFields;
140
138
  }
141
139
  __name(getExpandedSensitiveFields, "getExpandedSensitiveFields");
@@ -158,8 +156,8 @@ function setupLogger(isGlobal = true) {
158
156
  ...sensitiveFields.flatMap((field) => generateDeepPaths(field, 2))
159
157
  ]);
160
158
  const logParams = {
161
- name: config.defaultCatbeeConfig.logger?.name || "@catbee/utils",
162
- level: config.defaultCatbeeConfig.logger?.level || "info",
159
+ name: config.getCatbeeGlobalConfig().logger?.name || "@catbee/utils",
160
+ level: config.getCatbeeGlobalConfig().logger?.level || "info",
163
161
  redact: {
164
162
  paths: Array.from(paths),
165
163
  censor: /* @__PURE__ */ __name((value, path) => redact(value, path), "censor")
@@ -175,25 +173,25 @@ function setupLogger(isGlobal = true) {
175
173
  timestamp: pino.stdTimeFunctions.isoTime
176
174
  };
177
175
  let logger;
178
- const logDir = config.defaultCatbeeConfig.logger?.dir?.trim();
176
+ const logDir = config.getCatbeeGlobalConfig().logger?.dir?.trim();
179
177
  const hasFileLogging = Boolean(logDir);
180
- if (hasFileLogging && config.defaultCatbeeConfig.logger?.pretty) {
178
+ if (hasFileLogging && config.getCatbeeGlobalConfig().logger?.pretty) {
181
179
  logger = pino__default.default(logParams, pino__default.default.transport({
182
180
  targets: [
183
181
  {
184
182
  target: "pino-pretty",
185
- level: config.defaultCatbeeConfig.logger?.level ?? "info",
183
+ level: config.getCatbeeGlobalConfig().logger?.level ?? "info",
186
184
  options: {
187
- colorize: config.defaultCatbeeConfig.logger?.colorize,
185
+ colorize: config.getCatbeeGlobalConfig().logger?.colorize,
188
186
  translateTime: "SYS:standard",
189
187
  ignore: "pid,hostname",
190
- singleLine: config.defaultCatbeeConfig.logger?.singleLine,
188
+ singleLine: config.getCatbeeGlobalConfig().logger?.singleLine,
191
189
  levelFirst: true
192
190
  }
193
191
  },
194
192
  {
195
193
  target: "pino/file",
196
- level: config.defaultCatbeeConfig.logger?.level ?? "info",
194
+ level: config.getCatbeeGlobalConfig().logger?.level ?? "info",
197
195
  options: {
198
196
  destination: `${logDir}/app.log`,
199
197
  mkdir: true
@@ -209,14 +207,14 @@ function setupLogger(isGlobal = true) {
209
207
  mkdir: true
210
208
  }
211
209
  }));
212
- } else if (config.defaultCatbeeConfig.logger?.pretty) {
210
+ } else if (config.getCatbeeGlobalConfig().logger?.pretty) {
213
211
  logger = pino__default.default(logParams, pino__default.default.transport({
214
212
  target: "pino-pretty",
215
213
  options: {
216
- colorize: config.defaultCatbeeConfig.logger?.colorize,
214
+ colorize: config.getCatbeeGlobalConfig().logger?.colorize,
217
215
  translateTime: "SYS:standard",
218
216
  ignore: "pid,hostname",
219
- singleLine: config.defaultCatbeeConfig.logger?.singleLine,
217
+ singleLine: config.getCatbeeGlobalConfig().logger?.singleLine,
220
218
  levelFirst: true
221
219
  }
222
220
  }));