@js-utils-kit/constants 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Sriman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ const e=`abcdefghijklmnopqrstuvwxyz`,t=`ABCDEFGHIJKLMNOPQRSTUVWXYZ`,n=`0123456789`,r=e+t+n,i=[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`,`OPTIONS`,`CONNECT`,`TRACE`],a={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,IM_USED:226,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTH_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511},o=Math.PI,s=Math.PI*2,c=Math.E,l=Math.SQRT2,u=Math.SQRT1_2,d=Math.LN2,f=Math.LN10,p=Math.LOG2E,m=Math.LOG10E,h=2**53-1,g=-(2**53-1),_=Number.MAX_VALUE,v=Number.MIN_VALUE,y=2**-52,b=1e3,x=60*b,S=60*x,C=24*S;7*C,30.4375*C,365.25*C;const w=o/180,T=180/o;exports.ALPHANUMERIC=r,exports.CM_TO_MM=10,exports.DAY=C,exports.DEFAULT_RADIX=10,exports.DEG_TO_RAD=w,exports.DIGITS=n,exports.E=c,exports.EMPTY_STRING=``,exports.EPSILON=y,exports.GAS=8.314462618,exports.GRAVITY=9.80665,exports.HOUR=S,exports.HTTP_METHODS=i,exports.HTTP_STATUS=a,exports.KG_TO_G=1e3,exports.KM_TO_M=1e3,exports.LN_10=f,exports.LN_2=d,exports.LOG10_E=m,exports.LOG2_E=p,exports.LOWERCASE_ALPHABET=e,exports.MAX_SAFE_INT=h,exports.MAX_VALUE=_,exports.MINUTE=x,exports.MIN_SAFE_INT=g,exports.MIN_VALUE=v,exports.MONTH_AVG=26298e5,exports.M_TO_CM=100,exports.NEGATIVE_INFINITY=-1/0,exports.NEW_LINE=`
2
+ `,exports.PI=o,exports.PLANCK=662607015e-42,exports.POSITIVE_INFINITY=1/0,exports.RAD_TO_DEG=T,exports.SECOND=b,exports.SPACE=` `,exports.SPEED_OF_LIGHT=299792458,exports.SQRT_1_2=u,exports.SQRT_2=l,exports.TAB=` `,exports.TAU=s,exports.TON_TO_KG=1e3,exports.UPPERCASE_ALPHABET=t,exports.WEEK=6048e5,exports.YEAR=315576e5;
@@ -0,0 +1,281 @@
1
+ //#region src/charset.d.ts
2
+ /**
3
+ * Lowercase English alphabet.
4
+ */
5
+ declare const LOWERCASE_ALPHABET = "abcdefghijklmnopqrstuvwxyz";
6
+ /**
7
+ * Uppercase English alphabet.
8
+ */
9
+ declare const UPPERCASE_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
10
+ /**
11
+ * Numeric characters.
12
+ */
13
+ declare const DIGITS = "0123456789";
14
+ /**
15
+ * Alphanumeric characters.
16
+ */
17
+ declare const ALPHANUMERIC: string;
18
+ //#endregion
19
+ //#region src/http.d.ts
20
+ /**
21
+ * List of supported HTTP request methods.
22
+ */
23
+ declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
24
+ /**
25
+ * Common HTTP status codes.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * res.status(HTTP_STATUS.OK).json({ success: true })
30
+ * ```
31
+ */
32
+ declare const HTTP_STATUS: {
33
+ /** Request received, continuing process */readonly CONTINUE: 100; /** Switching protocols as requested */
34
+ readonly SWITCHING_PROTOCOLS: 101; /** WebDAV: Processing request */
35
+ readonly PROCESSING: 102; /** Early hints before final response */
36
+ readonly EARLY_HINTS: 103; /** Request succeeded */
37
+ readonly OK: 200; /** Resource successfully created */
38
+ readonly CREATED: 201; /** Request accepted but not yet processed */
39
+ readonly ACCEPTED: 202; /** Non-authoritative information */
40
+ readonly NON_AUTHORITATIVE_INFORMATION: 203; /** Request successful but no content returned */
41
+ readonly NO_CONTENT: 204; /** Reset view/document */
42
+ readonly RESET_CONTENT: 205; /** Partial content returned */
43
+ readonly PARTIAL_CONTENT: 206; /** WebDAV: Multi-status response */
44
+ readonly MULTI_STATUS: 207; /** WebDAV: Already reported */
45
+ readonly ALREADY_REPORTED: 208; /** Response successfully processed but no body */
46
+ readonly IM_USED: 226; /** Multiple response choices */
47
+ readonly MULTIPLE_CHOICES: 300; /** Resource permanently moved */
48
+ readonly MOVED_PERMANENTLY: 301; /** Resource found at a different URI */
49
+ readonly FOUND: 302; /** See another URI using GET */
50
+ readonly SEE_OTHER: 303; /** Resource not modified */
51
+ readonly NOT_MODIFIED: 304;
52
+ /**
53
+ * Use proxy.
54
+ *
55
+ * @deprecated
56
+ */
57
+ readonly USE_PROXY: 305; /** Temporary redirect */
58
+ readonly TEMPORARY_REDIRECT: 307; /** Permanent redirect */
59
+ readonly PERMANENT_REDIRECT: 308; /** Invalid request syntax */
60
+ readonly BAD_REQUEST: 400; /** Authentication required */
61
+ readonly UNAUTHORIZED: 401; /** Payment required (reserved) */
62
+ readonly PAYMENT_REQUIRED: 402; /** Access forbidden */
63
+ readonly FORBIDDEN: 403; /** Resource not found */
64
+ readonly NOT_FOUND: 404; /** Method not allowed */
65
+ readonly METHOD_NOT_ALLOWED: 405; /** Not acceptable */
66
+ readonly NOT_ACCEPTABLE: 406; /** Proxy authentication required */
67
+ readonly PROXY_AUTH_REQUIRED: 407; /** Request timeout */
68
+ readonly REQUEST_TIMEOUT: 408; /** Request conflict */
69
+ readonly CONFLICT: 409; /** Resource no longer available */
70
+ readonly GONE: 410; /** Length required */
71
+ readonly LENGTH_REQUIRED: 411; /** Precondition failed */
72
+ readonly PRECONDITION_FAILED: 412; /** Payload too large */
73
+ readonly PAYLOAD_TOO_LARGE: 413; /** URI too long */
74
+ readonly URI_TOO_LONG: 414; /** Unsupported media type */
75
+ readonly UNSUPPORTED_MEDIA_TYPE: 415; /** Range not satisfiable */
76
+ readonly RANGE_NOT_SATISFIABLE: 416; /** Expectation failed */
77
+ readonly EXPECTATION_FAILED: 417; /** Teapot */
78
+ readonly IM_A_TEAPOT: 418; /** Misdirected request */
79
+ readonly MISDIRECTED_REQUEST: 421; /** Unprocessable entity */
80
+ readonly UNPROCESSABLE_ENTITY: 422; /** Resource locked */
81
+ readonly LOCKED: 423; /** Failed dependency */
82
+ readonly FAILED_DEPENDENCY: 424; /** Too early */
83
+ readonly TOO_EARLY: 425; /** Upgrade required */
84
+ readonly UPGRADE_REQUIRED: 426; /** Precondition required */
85
+ readonly PRECONDITION_REQUIRED: 428; /** Too many requests (rate limited) */
86
+ readonly TOO_MANY_REQUESTS: 429; /** Request header fields too large */
87
+ readonly REQUEST_HEADER_FIELDS_TOO_LARGE: 431; /** Unavailable for legal reasons */
88
+ readonly UNAVAILABLE_FOR_LEGAL_REASONS: 451; /** Internal server error */
89
+ readonly INTERNAL_SERVER_ERROR: 500; /** Not implemented */
90
+ readonly NOT_IMPLEMENTED: 501; /** Bad gateway */
91
+ readonly BAD_GATEWAY: 502; /** Service unavailable */
92
+ readonly SERVICE_UNAVAILABLE: 503; /** Gateway timeout */
93
+ readonly GATEWAY_TIMEOUT: 504; /** HTTP version not supported */
94
+ readonly HTTP_VERSION_NOT_SUPPORTED: 505; /** Variant also negotiates */
95
+ readonly VARIANT_ALSO_NEGOTIATES: 506; /** Insufficient storage */
96
+ readonly INSUFFICIENT_STORAGE: 507; /** Loop detected */
97
+ readonly LOOP_DETECTED: 508; /** Bandwidth limit exceeded */
98
+ readonly BANDWIDTH_LIMIT_EXCEEDED: 509; /** Not extended */
99
+ readonly NOT_EXTENDED: 510; /** Network authentication required */
100
+ readonly NETWORK_AUTHENTICATION_REQUIRED: 511;
101
+ };
102
+ //#endregion
103
+ //#region src/math.d.ts
104
+ /**
105
+ * Ratio of a circle's circumference to its diameter.
106
+ */
107
+ declare const PI: number;
108
+ /**
109
+ * Full circle constant (2 × PI).
110
+ */
111
+ declare const TAU: number;
112
+ /**
113
+ * Euler's number - the base of natural logarithms.
114
+ */
115
+ declare const E: number;
116
+ /**
117
+ * Square root of 2.
118
+ */
119
+ declare const SQRT_2: number;
120
+ /**
121
+ * Square root of 1 / 2.
122
+ */
123
+ declare const SQRT_1_2: number;
124
+ /**
125
+ * Natural logarithm of 2.
126
+ *
127
+ * Represents `ln(2)`.
128
+ */
129
+ declare const LN_2: number;
130
+ /**
131
+ * Natural logarithm of 10.
132
+ *
133
+ * Represents `ln(10)`.
134
+ */
135
+ declare const LN_10: number;
136
+ /**
137
+ * Base-2 logarithm of Euler's number.
138
+ *
139
+ * Represents `log₂(e)`.
140
+ */
141
+ declare const LOG2_E: number;
142
+ /**
143
+ * Base-10 logarithm of Euler's number.
144
+ *
145
+ * Represents `log₁₀(e)`.
146
+ *
147
+ * @default Math.LOG10E
148
+ */
149
+ declare const LOG10_E: number;
150
+ //#endregion
151
+ //#region src/numbers.d.ts
152
+ /**
153
+ * Maximum safe integer.
154
+ */
155
+ declare const MAX_SAFE_INT: number;
156
+ /**
157
+ * Minimum safe integer.
158
+ */
159
+ declare const MIN_SAFE_INT: number;
160
+ /**
161
+ * Largest representable number.
162
+ */
163
+ declare const MAX_VALUE: number;
164
+ /**
165
+ * Smallest positive representable number.
166
+ */
167
+ declare const MIN_VALUE: number;
168
+ /**
169
+ * Smallest difference between two representable numbers.
170
+ */
171
+ declare const EPSILON: number;
172
+ /**
173
+ * Positive infinity value.
174
+ */
175
+ declare const POSITIVE_INFINITY: number;
176
+ /**
177
+ * Negative infinity value.
178
+ */
179
+ declare const NEGATIVE_INFINITY: number;
180
+ /**
181
+ * Default radix for number parsing.
182
+ */
183
+ declare const DEFAULT_RADIX = 10;
184
+ //#endregion
185
+ //#region src/physics.d.ts
186
+ /**
187
+ * Speed of light in vacuum (m/s).
188
+ */
189
+ declare const SPEED_OF_LIGHT = 299792458;
190
+ /**
191
+ * Standard gravity (m/s²).
192
+ */
193
+ declare const GRAVITY = 9.80665;
194
+ /**
195
+ * Planck constant (J·s).
196
+ */
197
+ declare const PLANCK = 6.62607015e-34;
198
+ /**
199
+ * Universal gas constant (J/(mol·K)).
200
+ */
201
+ declare const GAS = 8.314462618;
202
+ //#endregion
203
+ //#region src/symbols.d.ts
204
+ /**
205
+ * New line character.
206
+ */
207
+ declare const NEW_LINE = "\n";
208
+ /**
209
+ * Tab character.
210
+ */
211
+ declare const TAB = "\t";
212
+ /**
213
+ * Space character.
214
+ */
215
+ declare const SPACE = " ";
216
+ /**
217
+ * Empty string constant.
218
+ */
219
+ declare const EMPTY_STRING = "";
220
+ //#endregion
221
+ //#region src/time.d.ts
222
+ /**
223
+ * Milliseconds in one second.
224
+ */
225
+ declare const SECOND = 1000;
226
+ /**
227
+ * Milliseconds in one minute.
228
+ */
229
+ declare const MINUTE: number;
230
+ /**
231
+ * Milliseconds in one hour.
232
+ */
233
+ declare const HOUR: number;
234
+ /**
235
+ * Milliseconds in one day.
236
+ */
237
+ declare const DAY: number;
238
+ /**
239
+ * Milliseconds in one week.
240
+ */
241
+ declare const WEEK: number;
242
+ /**
243
+ * Average milliseconds in a month.
244
+ */
245
+ declare const MONTH_AVG: number;
246
+ /**
247
+ * Milliseconds in one year (leap-year adjusted).
248
+ */
249
+ declare const YEAR: number;
250
+ //#endregion
251
+ //#region src/units.d.ts
252
+ /**
253
+ * Kilometers to meters factor.
254
+ */
255
+ declare const KM_TO_M = 1000;
256
+ /**
257
+ * Meters to centimeters factor.
258
+ */
259
+ declare const M_TO_CM = 100;
260
+ /**
261
+ * Centimeters to millimeters factor.
262
+ */
263
+ declare const CM_TO_MM = 10;
264
+ /**
265
+ * Kilograms to grams factor.
266
+ */
267
+ declare const KG_TO_G = 1000;
268
+ /**
269
+ * Tons to kilograms factor.
270
+ */
271
+ declare const TON_TO_KG = 1000;
272
+ /**
273
+ * Degrees to radians factor.
274
+ */
275
+ declare const DEG_TO_RAD: number;
276
+ /**
277
+ * Radians to degrees factor.
278
+ */
279
+ declare const RAD_TO_DEG: number;
280
+ //#endregion
281
+ export { ALPHANUMERIC, CM_TO_MM, DAY, DEFAULT_RADIX, DEG_TO_RAD, DIGITS, E, EMPTY_STRING, EPSILON, GAS, GRAVITY, HOUR, HTTP_METHODS, HTTP_STATUS, KG_TO_G, KM_TO_M, LN_10, LN_2, LOG10_E, LOG2_E, LOWERCASE_ALPHABET, MAX_SAFE_INT, MAX_VALUE, MINUTE, MIN_SAFE_INT, MIN_VALUE, MONTH_AVG, M_TO_CM, NEGATIVE_INFINITY, NEW_LINE, PI, PLANCK, POSITIVE_INFINITY, RAD_TO_DEG, SECOND, SPACE, SPEED_OF_LIGHT, SQRT_1_2, SQRT_2, TAB, TAU, TON_TO_KG, UPPERCASE_ALPHABET, WEEK, YEAR };
@@ -0,0 +1,281 @@
1
+ //#region src/charset.d.ts
2
+ /**
3
+ * Lowercase English alphabet.
4
+ */
5
+ declare const LOWERCASE_ALPHABET = "abcdefghijklmnopqrstuvwxyz";
6
+ /**
7
+ * Uppercase English alphabet.
8
+ */
9
+ declare const UPPERCASE_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
10
+ /**
11
+ * Numeric characters.
12
+ */
13
+ declare const DIGITS = "0123456789";
14
+ /**
15
+ * Alphanumeric characters.
16
+ */
17
+ declare const ALPHANUMERIC: string;
18
+ //#endregion
19
+ //#region src/http.d.ts
20
+ /**
21
+ * List of supported HTTP request methods.
22
+ */
23
+ declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
24
+ /**
25
+ * Common HTTP status codes.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * res.status(HTTP_STATUS.OK).json({ success: true })
30
+ * ```
31
+ */
32
+ declare const HTTP_STATUS: {
33
+ /** Request received, continuing process */readonly CONTINUE: 100; /** Switching protocols as requested */
34
+ readonly SWITCHING_PROTOCOLS: 101; /** WebDAV: Processing request */
35
+ readonly PROCESSING: 102; /** Early hints before final response */
36
+ readonly EARLY_HINTS: 103; /** Request succeeded */
37
+ readonly OK: 200; /** Resource successfully created */
38
+ readonly CREATED: 201; /** Request accepted but not yet processed */
39
+ readonly ACCEPTED: 202; /** Non-authoritative information */
40
+ readonly NON_AUTHORITATIVE_INFORMATION: 203; /** Request successful but no content returned */
41
+ readonly NO_CONTENT: 204; /** Reset view/document */
42
+ readonly RESET_CONTENT: 205; /** Partial content returned */
43
+ readonly PARTIAL_CONTENT: 206; /** WebDAV: Multi-status response */
44
+ readonly MULTI_STATUS: 207; /** WebDAV: Already reported */
45
+ readonly ALREADY_REPORTED: 208; /** Response successfully processed but no body */
46
+ readonly IM_USED: 226; /** Multiple response choices */
47
+ readonly MULTIPLE_CHOICES: 300; /** Resource permanently moved */
48
+ readonly MOVED_PERMANENTLY: 301; /** Resource found at a different URI */
49
+ readonly FOUND: 302; /** See another URI using GET */
50
+ readonly SEE_OTHER: 303; /** Resource not modified */
51
+ readonly NOT_MODIFIED: 304;
52
+ /**
53
+ * Use proxy.
54
+ *
55
+ * @deprecated
56
+ */
57
+ readonly USE_PROXY: 305; /** Temporary redirect */
58
+ readonly TEMPORARY_REDIRECT: 307; /** Permanent redirect */
59
+ readonly PERMANENT_REDIRECT: 308; /** Invalid request syntax */
60
+ readonly BAD_REQUEST: 400; /** Authentication required */
61
+ readonly UNAUTHORIZED: 401; /** Payment required (reserved) */
62
+ readonly PAYMENT_REQUIRED: 402; /** Access forbidden */
63
+ readonly FORBIDDEN: 403; /** Resource not found */
64
+ readonly NOT_FOUND: 404; /** Method not allowed */
65
+ readonly METHOD_NOT_ALLOWED: 405; /** Not acceptable */
66
+ readonly NOT_ACCEPTABLE: 406; /** Proxy authentication required */
67
+ readonly PROXY_AUTH_REQUIRED: 407; /** Request timeout */
68
+ readonly REQUEST_TIMEOUT: 408; /** Request conflict */
69
+ readonly CONFLICT: 409; /** Resource no longer available */
70
+ readonly GONE: 410; /** Length required */
71
+ readonly LENGTH_REQUIRED: 411; /** Precondition failed */
72
+ readonly PRECONDITION_FAILED: 412; /** Payload too large */
73
+ readonly PAYLOAD_TOO_LARGE: 413; /** URI too long */
74
+ readonly URI_TOO_LONG: 414; /** Unsupported media type */
75
+ readonly UNSUPPORTED_MEDIA_TYPE: 415; /** Range not satisfiable */
76
+ readonly RANGE_NOT_SATISFIABLE: 416; /** Expectation failed */
77
+ readonly EXPECTATION_FAILED: 417; /** Teapot */
78
+ readonly IM_A_TEAPOT: 418; /** Misdirected request */
79
+ readonly MISDIRECTED_REQUEST: 421; /** Unprocessable entity */
80
+ readonly UNPROCESSABLE_ENTITY: 422; /** Resource locked */
81
+ readonly LOCKED: 423; /** Failed dependency */
82
+ readonly FAILED_DEPENDENCY: 424; /** Too early */
83
+ readonly TOO_EARLY: 425; /** Upgrade required */
84
+ readonly UPGRADE_REQUIRED: 426; /** Precondition required */
85
+ readonly PRECONDITION_REQUIRED: 428; /** Too many requests (rate limited) */
86
+ readonly TOO_MANY_REQUESTS: 429; /** Request header fields too large */
87
+ readonly REQUEST_HEADER_FIELDS_TOO_LARGE: 431; /** Unavailable for legal reasons */
88
+ readonly UNAVAILABLE_FOR_LEGAL_REASONS: 451; /** Internal server error */
89
+ readonly INTERNAL_SERVER_ERROR: 500; /** Not implemented */
90
+ readonly NOT_IMPLEMENTED: 501; /** Bad gateway */
91
+ readonly BAD_GATEWAY: 502; /** Service unavailable */
92
+ readonly SERVICE_UNAVAILABLE: 503; /** Gateway timeout */
93
+ readonly GATEWAY_TIMEOUT: 504; /** HTTP version not supported */
94
+ readonly HTTP_VERSION_NOT_SUPPORTED: 505; /** Variant also negotiates */
95
+ readonly VARIANT_ALSO_NEGOTIATES: 506; /** Insufficient storage */
96
+ readonly INSUFFICIENT_STORAGE: 507; /** Loop detected */
97
+ readonly LOOP_DETECTED: 508; /** Bandwidth limit exceeded */
98
+ readonly BANDWIDTH_LIMIT_EXCEEDED: 509; /** Not extended */
99
+ readonly NOT_EXTENDED: 510; /** Network authentication required */
100
+ readonly NETWORK_AUTHENTICATION_REQUIRED: 511;
101
+ };
102
+ //#endregion
103
+ //#region src/math.d.ts
104
+ /**
105
+ * Ratio of a circle's circumference to its diameter.
106
+ */
107
+ declare const PI: number;
108
+ /**
109
+ * Full circle constant (2 × PI).
110
+ */
111
+ declare const TAU: number;
112
+ /**
113
+ * Euler's number - the base of natural logarithms.
114
+ */
115
+ declare const E: number;
116
+ /**
117
+ * Square root of 2.
118
+ */
119
+ declare const SQRT_2: number;
120
+ /**
121
+ * Square root of 1 / 2.
122
+ */
123
+ declare const SQRT_1_2: number;
124
+ /**
125
+ * Natural logarithm of 2.
126
+ *
127
+ * Represents `ln(2)`.
128
+ */
129
+ declare const LN_2: number;
130
+ /**
131
+ * Natural logarithm of 10.
132
+ *
133
+ * Represents `ln(10)`.
134
+ */
135
+ declare const LN_10: number;
136
+ /**
137
+ * Base-2 logarithm of Euler's number.
138
+ *
139
+ * Represents `log₂(e)`.
140
+ */
141
+ declare const LOG2_E: number;
142
+ /**
143
+ * Base-10 logarithm of Euler's number.
144
+ *
145
+ * Represents `log₁₀(e)`.
146
+ *
147
+ * @default Math.LOG10E
148
+ */
149
+ declare const LOG10_E: number;
150
+ //#endregion
151
+ //#region src/numbers.d.ts
152
+ /**
153
+ * Maximum safe integer.
154
+ */
155
+ declare const MAX_SAFE_INT: number;
156
+ /**
157
+ * Minimum safe integer.
158
+ */
159
+ declare const MIN_SAFE_INT: number;
160
+ /**
161
+ * Largest representable number.
162
+ */
163
+ declare const MAX_VALUE: number;
164
+ /**
165
+ * Smallest positive representable number.
166
+ */
167
+ declare const MIN_VALUE: number;
168
+ /**
169
+ * Smallest difference between two representable numbers.
170
+ */
171
+ declare const EPSILON: number;
172
+ /**
173
+ * Positive infinity value.
174
+ */
175
+ declare const POSITIVE_INFINITY: number;
176
+ /**
177
+ * Negative infinity value.
178
+ */
179
+ declare const NEGATIVE_INFINITY: number;
180
+ /**
181
+ * Default radix for number parsing.
182
+ */
183
+ declare const DEFAULT_RADIX = 10;
184
+ //#endregion
185
+ //#region src/physics.d.ts
186
+ /**
187
+ * Speed of light in vacuum (m/s).
188
+ */
189
+ declare const SPEED_OF_LIGHT = 299792458;
190
+ /**
191
+ * Standard gravity (m/s²).
192
+ */
193
+ declare const GRAVITY = 9.80665;
194
+ /**
195
+ * Planck constant (J·s).
196
+ */
197
+ declare const PLANCK = 6.62607015e-34;
198
+ /**
199
+ * Universal gas constant (J/(mol·K)).
200
+ */
201
+ declare const GAS = 8.314462618;
202
+ //#endregion
203
+ //#region src/symbols.d.ts
204
+ /**
205
+ * New line character.
206
+ */
207
+ declare const NEW_LINE = "\n";
208
+ /**
209
+ * Tab character.
210
+ */
211
+ declare const TAB = "\t";
212
+ /**
213
+ * Space character.
214
+ */
215
+ declare const SPACE = " ";
216
+ /**
217
+ * Empty string constant.
218
+ */
219
+ declare const EMPTY_STRING = "";
220
+ //#endregion
221
+ //#region src/time.d.ts
222
+ /**
223
+ * Milliseconds in one second.
224
+ */
225
+ declare const SECOND = 1000;
226
+ /**
227
+ * Milliseconds in one minute.
228
+ */
229
+ declare const MINUTE: number;
230
+ /**
231
+ * Milliseconds in one hour.
232
+ */
233
+ declare const HOUR: number;
234
+ /**
235
+ * Milliseconds in one day.
236
+ */
237
+ declare const DAY: number;
238
+ /**
239
+ * Milliseconds in one week.
240
+ */
241
+ declare const WEEK: number;
242
+ /**
243
+ * Average milliseconds in a month.
244
+ */
245
+ declare const MONTH_AVG: number;
246
+ /**
247
+ * Milliseconds in one year (leap-year adjusted).
248
+ */
249
+ declare const YEAR: number;
250
+ //#endregion
251
+ //#region src/units.d.ts
252
+ /**
253
+ * Kilometers to meters factor.
254
+ */
255
+ declare const KM_TO_M = 1000;
256
+ /**
257
+ * Meters to centimeters factor.
258
+ */
259
+ declare const M_TO_CM = 100;
260
+ /**
261
+ * Centimeters to millimeters factor.
262
+ */
263
+ declare const CM_TO_MM = 10;
264
+ /**
265
+ * Kilograms to grams factor.
266
+ */
267
+ declare const KG_TO_G = 1000;
268
+ /**
269
+ * Tons to kilograms factor.
270
+ */
271
+ declare const TON_TO_KG = 1000;
272
+ /**
273
+ * Degrees to radians factor.
274
+ */
275
+ declare const DEG_TO_RAD: number;
276
+ /**
277
+ * Radians to degrees factor.
278
+ */
279
+ declare const RAD_TO_DEG: number;
280
+ //#endregion
281
+ export { ALPHANUMERIC, CM_TO_MM, DAY, DEFAULT_RADIX, DEG_TO_RAD, DIGITS, E, EMPTY_STRING, EPSILON, GAS, GRAVITY, HOUR, HTTP_METHODS, HTTP_STATUS, KG_TO_G, KM_TO_M, LN_10, LN_2, LOG10_E, LOG2_E, LOWERCASE_ALPHABET, MAX_SAFE_INT, MAX_VALUE, MINUTE, MIN_SAFE_INT, MIN_VALUE, MONTH_AVG, M_TO_CM, NEGATIVE_INFINITY, NEW_LINE, PI, PLANCK, POSITIVE_INFINITY, RAD_TO_DEG, SECOND, SPACE, SPEED_OF_LIGHT, SQRT_1_2, SQRT_2, TAB, TAU, TON_TO_KG, UPPERCASE_ALPHABET, WEEK, YEAR };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ const e=`abcdefghijklmnopqrstuvwxyz`,t=`ABCDEFGHIJKLMNOPQRSTUVWXYZ`,n=`0123456789`,r=e+t+n,i=[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`,`OPTIONS`,`CONNECT`,`TRACE`],a={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,IM_USED:226,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTH_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511},o=Math.PI,s=Math.PI*2,c=Math.E,l=Math.SQRT2,u=Math.SQRT1_2,d=Math.LN2,f=Math.LN10,p=Math.LOG2E,m=Math.LOG10E,h=2**53-1,g=-(2**53-1),_=Number.MAX_VALUE,v=Number.MIN_VALUE,y=2**-52,b=1/0,x=-1/0,S=10,C=299792458,w=9.80665,T=662607015e-42,E=8.314462618,D=`
2
+ `,O=` `,k=` `,A=``,j=1e3,M=60*j,N=60*M,P=24*N,F=7*P,I=30.4375*P,L=365.25*P,R=1e3,z=100,B=10,V=1e3,H=1e3,U=o/180,W=180/o;export{r as ALPHANUMERIC,B as CM_TO_MM,P as DAY,S as DEFAULT_RADIX,U as DEG_TO_RAD,n as DIGITS,c as E,A as EMPTY_STRING,y as EPSILON,E as GAS,w as GRAVITY,N as HOUR,i as HTTP_METHODS,a as HTTP_STATUS,V as KG_TO_G,R as KM_TO_M,f as LN_10,d as LN_2,m as LOG10_E,p as LOG2_E,e as LOWERCASE_ALPHABET,h as MAX_SAFE_INT,_ as MAX_VALUE,M as MINUTE,g as MIN_SAFE_INT,v as MIN_VALUE,I as MONTH_AVG,z as M_TO_CM,x as NEGATIVE_INFINITY,D as NEW_LINE,o as PI,T as PLANCK,b as POSITIVE_INFINITY,W as RAD_TO_DEG,j as SECOND,k as SPACE,C as SPEED_OF_LIGHT,u as SQRT_1_2,l as SQRT_2,O as TAB,s as TAU,H as TON_TO_KG,t as UPPERCASE_ALPHABET,F as WEEK,L as YEAR};
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@js-utils-kit/constants",
3
+ "version": "0.1.0",
4
+ "description": "Commonly used constants utilities",
5
+ "private": false,
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Sriman",
9
+ "email": "136729116+TenEplaysOfficial@users.noreply.github.com",
10
+ "url": "https://tene.vercel.app"
11
+ },
12
+ "homepage": "https://js-utils.js.org",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/teneplaysofficial/js-utils-kit",
16
+ "directory": "packages/@js-utils-kit/constants"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/teneplaysofficial/js-utils-kit/issues"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "engines": {
25
+ "node": ">=22"
26
+ },
27
+ "type": "module",
28
+ "main": "./dist/index.cjs",
29
+ "module": "./dist/index.mjs",
30
+ "types": "./dist/index.d.cts",
31
+ "exports": {
32
+ ".": {
33
+ "require": "./dist/index.cjs",
34
+ "import": "./dist/index.mjs"
35
+ }
36
+ },
37
+ "dependencies": {},
38
+ "scripts": {
39
+ "build": "tsdown"
40
+ }
41
+ }