@mionjs/type-formats 0.8.0-alpha.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 (134) hide show
  1. package/.dist/cjs/BigintFormats.cjs +14 -0
  2. package/.dist/cjs/BigintFormats.cjs.map +1 -0
  3. package/.dist/cjs/BigintFormats.d.ts +2 -0
  4. package/.dist/cjs/NumberFormats.cjs +20 -0
  5. package/.dist/cjs/NumberFormats.cjs.map +1 -0
  6. package/.dist/cjs/NumberFormats.d.ts +2 -0
  7. package/.dist/cjs/StringFormats.cjs +120 -0
  8. package/.dist/cjs/StringFormats.cjs.map +1 -0
  9. package/.dist/cjs/StringFormats.d.ts +11 -0
  10. package/.dist/cjs/constants.d.ts +1 -0
  11. package/.dist/cjs/package.json +1 -0
  12. package/.dist/cjs/src/bigint/bigIntFormat.runtype.cjs +152 -0
  13. package/.dist/cjs/src/bigint/bigIntFormat.runtype.cjs.map +1 -0
  14. package/.dist/cjs/src/bigint/bigIntFormat.runtype.d.ts +21 -0
  15. package/.dist/cjs/src/bigint/defaultBigNumberFormats.cjs +16 -0
  16. package/.dist/cjs/src/bigint/defaultBigNumberFormats.cjs.map +1 -0
  17. package/.dist/cjs/src/bigint/defaultBigNumberFormats.d.ts +29 -0
  18. package/.dist/cjs/src/constants.cjs +34 -0
  19. package/.dist/cjs/src/constants.cjs.map +1 -0
  20. package/.dist/cjs/src/constants.d.ts +15 -0
  21. package/.dist/cjs/src/constants.mock.cjs +111 -0
  22. package/.dist/cjs/src/constants.mock.cjs.map +1 -0
  23. package/.dist/cjs/src/constants.mock.d.ts +335 -0
  24. package/.dist/cjs/src/number/defaultNumberFormats.cjs +28 -0
  25. package/.dist/cjs/src/number/defaultNumberFormats.cjs.map +1 -0
  26. package/.dist/cjs/src/number/defaultNumberFormats.d.ts +63 -0
  27. package/.dist/cjs/src/number/numberFormat.runtype.cjs +214 -0
  28. package/.dist/cjs/src/number/numberFormat.runtype.cjs.map +1 -0
  29. package/.dist/cjs/src/number/numberFormat.runtype.d.ts +21 -0
  30. package/.dist/cjs/src/string/date.runtype.cjs +88 -0
  31. package/.dist/cjs/src/string/date.runtype.cjs.map +1 -0
  32. package/.dist/cjs/src/string/date.runtype.d.ts +19 -0
  33. package/.dist/cjs/src/string/dateTime.runtype.cjs +83 -0
  34. package/.dist/cjs/src/string/dateTime.runtype.cjs.map +1 -0
  35. package/.dist/cjs/src/string/dateTime.runtype.d.ts +26 -0
  36. package/.dist/cjs/src/string/defaultStringFormats.runtype.cjs +25 -0
  37. package/.dist/cjs/src/string/defaultStringFormats.runtype.cjs.map +1 -0
  38. package/.dist/cjs/src/string/defaultStringFormats.runtype.d.ts +45 -0
  39. package/.dist/cjs/src/string/domain.runtype.cjs +248 -0
  40. package/.dist/cjs/src/string/domain.runtype.cjs.map +1 -0
  41. package/.dist/cjs/src/string/domain.runtype.d.ts +72 -0
  42. package/.dist/cjs/src/string/email.runtype.cjs +159 -0
  43. package/.dist/cjs/src/string/email.runtype.cjs.map +1 -0
  44. package/.dist/cjs/src/string/email.runtype.d.ts +57 -0
  45. package/.dist/cjs/src/string/ip.runtype.cjs +72 -0
  46. package/.dist/cjs/src/string/ip.runtype.cjs.map +1 -0
  47. package/.dist/cjs/src/string/ip.runtype.d.ts +50 -0
  48. package/.dist/cjs/src/string/stringFormat.runtype.cjs +270 -0
  49. package/.dist/cjs/src/string/stringFormat.runtype.cjs.map +1 -0
  50. package/.dist/cjs/src/string/stringFormat.runtype.d.ts +21 -0
  51. package/.dist/cjs/src/string/time.runtype.cjs +100 -0
  52. package/.dist/cjs/src/string/time.runtype.cjs.map +1 -0
  53. package/.dist/cjs/src/string/time.runtype.d.ts +21 -0
  54. package/.dist/cjs/src/string/url.runtype.cjs +160 -0
  55. package/.dist/cjs/src/string/url.runtype.cjs.map +1 -0
  56. package/.dist/cjs/src/string/url.runtype.d.ts +81 -0
  57. package/.dist/cjs/src/string/uuid.runtype.cjs +44 -0
  58. package/.dist/cjs/src/string/uuid.runtype.cjs.map +1 -0
  59. package/.dist/cjs/src/string/uuid.runtype.d.ts +22 -0
  60. package/.dist/cjs/src/type-formats-pure-fns.cjs +390 -0
  61. package/.dist/cjs/src/type-formats-pure-fns.cjs.map +1 -0
  62. package/.dist/cjs/src/type-formats-pure-fns.d.ts +27 -0
  63. package/.dist/cjs/src/utils.cjs +14 -0
  64. package/.dist/cjs/src/utils.cjs.map +1 -0
  65. package/.dist/cjs/src/utils.d.ts +3 -0
  66. package/.dist/cjs/vitest.config.d.ts +2 -0
  67. package/.dist/esm/BigintFormats.d.ts +2 -0
  68. package/.dist/esm/BigintFormats.js +14 -0
  69. package/.dist/esm/BigintFormats.js.map +1 -0
  70. package/.dist/esm/NumberFormats.d.ts +2 -0
  71. package/.dist/esm/NumberFormats.js +20 -0
  72. package/.dist/esm/NumberFormats.js.map +1 -0
  73. package/.dist/esm/StringFormats.d.ts +11 -0
  74. package/.dist/esm/StringFormats.js +120 -0
  75. package/.dist/esm/StringFormats.js.map +1 -0
  76. package/.dist/esm/constants.d.ts +1 -0
  77. package/.dist/esm/src/bigint/bigIntFormat.runtype.d.ts +21 -0
  78. package/.dist/esm/src/bigint/bigIntFormat.runtype.js +152 -0
  79. package/.dist/esm/src/bigint/bigIntFormat.runtype.js.map +1 -0
  80. package/.dist/esm/src/bigint/defaultBigNumberFormats.d.ts +29 -0
  81. package/.dist/esm/src/bigint/defaultBigNumberFormats.js +16 -0
  82. package/.dist/esm/src/bigint/defaultBigNumberFormats.js.map +1 -0
  83. package/.dist/esm/src/constants.d.ts +15 -0
  84. package/.dist/esm/src/constants.js +34 -0
  85. package/.dist/esm/src/constants.js.map +1 -0
  86. package/.dist/esm/src/constants.mock.d.ts +335 -0
  87. package/.dist/esm/src/constants.mock.js +111 -0
  88. package/.dist/esm/src/constants.mock.js.map +1 -0
  89. package/.dist/esm/src/number/defaultNumberFormats.d.ts +63 -0
  90. package/.dist/esm/src/number/defaultNumberFormats.js +28 -0
  91. package/.dist/esm/src/number/defaultNumberFormats.js.map +1 -0
  92. package/.dist/esm/src/number/numberFormat.runtype.d.ts +21 -0
  93. package/.dist/esm/src/number/numberFormat.runtype.js +214 -0
  94. package/.dist/esm/src/number/numberFormat.runtype.js.map +1 -0
  95. package/.dist/esm/src/string/date.runtype.d.ts +19 -0
  96. package/.dist/esm/src/string/date.runtype.js +88 -0
  97. package/.dist/esm/src/string/date.runtype.js.map +1 -0
  98. package/.dist/esm/src/string/dateTime.runtype.d.ts +26 -0
  99. package/.dist/esm/src/string/dateTime.runtype.js +83 -0
  100. package/.dist/esm/src/string/dateTime.runtype.js.map +1 -0
  101. package/.dist/esm/src/string/defaultStringFormats.runtype.d.ts +45 -0
  102. package/.dist/esm/src/string/defaultStringFormats.runtype.js +25 -0
  103. package/.dist/esm/src/string/defaultStringFormats.runtype.js.map +1 -0
  104. package/.dist/esm/src/string/domain.runtype.d.ts +72 -0
  105. package/.dist/esm/src/string/domain.runtype.js +248 -0
  106. package/.dist/esm/src/string/domain.runtype.js.map +1 -0
  107. package/.dist/esm/src/string/email.runtype.d.ts +57 -0
  108. package/.dist/esm/src/string/email.runtype.js +159 -0
  109. package/.dist/esm/src/string/email.runtype.js.map +1 -0
  110. package/.dist/esm/src/string/ip.runtype.d.ts +50 -0
  111. package/.dist/esm/src/string/ip.runtype.js +72 -0
  112. package/.dist/esm/src/string/ip.runtype.js.map +1 -0
  113. package/.dist/esm/src/string/stringFormat.runtype.d.ts +21 -0
  114. package/.dist/esm/src/string/stringFormat.runtype.js +270 -0
  115. package/.dist/esm/src/string/stringFormat.runtype.js.map +1 -0
  116. package/.dist/esm/src/string/time.runtype.d.ts +21 -0
  117. package/.dist/esm/src/string/time.runtype.js +100 -0
  118. package/.dist/esm/src/string/time.runtype.js.map +1 -0
  119. package/.dist/esm/src/string/url.runtype.d.ts +81 -0
  120. package/.dist/esm/src/string/url.runtype.js +160 -0
  121. package/.dist/esm/src/string/url.runtype.js.map +1 -0
  122. package/.dist/esm/src/string/uuid.runtype.d.ts +22 -0
  123. package/.dist/esm/src/string/uuid.runtype.js +44 -0
  124. package/.dist/esm/src/string/uuid.runtype.js.map +1 -0
  125. package/.dist/esm/src/type-formats-pure-fns.d.ts +27 -0
  126. package/.dist/esm/src/type-formats-pure-fns.js +390 -0
  127. package/.dist/esm/src/type-formats-pure-fns.js.map +1 -0
  128. package/.dist/esm/src/utils.d.ts +3 -0
  129. package/.dist/esm/src/utils.js +14 -0
  130. package/.dist/esm/src/utils.js.map +1 -0
  131. package/.dist/esm/vitest.config.d.ts +2 -0
  132. package/LICENSE +21 -0
  133. package/README.md +123 -0
  134. package/package.json +80 -0
@@ -0,0 +1,335 @@
1
+ export type EMAIL_NAME_SAMPLES = [
2
+ 'john.doe',
3
+ 'jane.smith',
4
+ 'admin',
5
+ 'support',
6
+ 'contact',
7
+ 'info',
8
+ 'sales',
9
+ 'marketing',
10
+ 'hello',
11
+ 'feedback',
12
+ 'user123',
13
+ 'test.account',
14
+ 'random.name',
15
+ 'developer',
16
+ 'webmaster',
17
+ 'juan.perez',
18
+ 'maria.garcia',
19
+ 'soporte',
20
+ 'contacto',
21
+ 'ventas',
22
+ 'informacion',
23
+ 'hola',
24
+ 'usuario',
25
+ 'prueba',
26
+ 'desarrollador',
27
+ 'jean.dupont',
28
+ 'marie.curie',
29
+ 'contact',
30
+ 'support',
31
+ 'vente',
32
+ 'bonjour',
33
+ 'utilisateur',
34
+ 'testeur',
35
+ 'developpeur',
36
+ 'hans.schmidt',
37
+ 'anna.müller',
38
+ 'kontakt',
39
+ 'hilfe',
40
+ 'verkauf',
41
+ 'benutzer',
42
+ 'testkonto',
43
+ 'entwickler',
44
+ 'giuseppe.rossi',
45
+ 'maria.bianchi',
46
+ 'contatto',
47
+ 'supporto',
48
+ 'vendite',
49
+ 'utente',
50
+ 'prova',
51
+ 'sviluppatore',
52
+ 'joao.silva',
53
+ 'maria.oliveira',
54
+ 'contato',
55
+ 'suporte',
56
+ 'vendas',
57
+ 'usuario',
58
+ 'teste',
59
+ 'desenvolvedor',
60
+ '홍길동',
61
+ '김철수',
62
+ '고객지원',
63
+ '연락처',
64
+ '판매',
65
+ '사용자',
66
+ '山田太郎',
67
+ '鈴木花子',
68
+ '情報',
69
+ 'サポート',
70
+ '日本語',
71
+ 'テスト',
72
+ '携帯',
73
+ '電子',
74
+ '李伟',
75
+ '王芳',
76
+ '张三',
77
+ '联系',
78
+ '测试',
79
+ '用户',
80
+ '开发',
81
+ 'arjun.sharma',
82
+ 'priya.kumar',
83
+ 'support',
84
+ 'contact',
85
+ 'vikas',
86
+ 'pariksha',
87
+ 'upayogakarta',
88
+ 'иван.иванов',
89
+ 'анна.петровна',
90
+ 'поддержка',
91
+ 'контакт',
92
+ 'продажи',
93
+ 'пользователь',
94
+ 'разработчик',
95
+ 'alpha.beta',
96
+ 'charlie.delta',
97
+ 'test123',
98
+ 'mock.user',
99
+ 'example.name',
100
+ 'first.last',
101
+ 'nickname',
102
+ 'alias',
103
+ 'temp.account',
104
+ 'demo.user'
105
+ ];
106
+ export type EMAIL_SAMPLES = [
107
+ 'john.doe@mion.io',
108
+ 'jane.smith@rpc.org',
109
+ 'admin@wiki.org',
110
+ 'support@www.mion.org',
111
+ 'contact@www.api.org',
112
+ 'info@arch.org',
113
+ 'sales@ccmns.org',
114
+ 'marketing@eff.org',
115
+ 'hello@fsf.org',
116
+ 'feedback@opensource.org',
117
+ 'user123@node.org',
118
+ 'test.account@typescript.org',
119
+ 'random.name@rpc.org',
120
+ 'developer@fullstack.org',
121
+ 'webmaster@mion.io',
122
+ 'juan.perez@wiki.org',
123
+ 'maria.garcia@arch.org',
124
+ 'soporte@ccmns.org',
125
+ 'contacto@eff.org',
126
+ 'ventas@fsf.org',
127
+ 'informacion@opensource.org',
128
+ 'hola@node.org',
129
+ 'usuario@typescript.org',
130
+ 'prueba@rpc.org',
131
+ 'desarrollador@fullstack.org',
132
+ 'jean.dupont@mion.io',
133
+ 'marie.curie@wiki.org',
134
+ 'vente@arch.org',
135
+ 'bonjour@ccmns.org',
136
+ 'utilisateur@eff.org',
137
+ 'testeur@fsf.org',
138
+ 'developpeur@opensource.org',
139
+ 'anna.müller@node.org',
140
+ 'anna.schmidt@typescript.org',
141
+ 'kontakt@rpc.org',
142
+ 'hilfe@fullstack.org',
143
+ 'verkauf@mion.io',
144
+ 'benutzer@wiki.org',
145
+ 'entwickler@arch.org',
146
+ '王芳@ccmns.org',
147
+ '联系@eff.org',
148
+ '测试@fsf.org',
149
+ 'ceshi@opensource.org',
150
+ '张三@node.org',
151
+ 'kaifa@typescript.org',
152
+ 'arjun.sharma@rpc.org',
153
+ 'priya.kumar@fullstack.org',
154
+ 'vikas@mion.io',
155
+ 'pariksha@wiki.org',
156
+ 'upayogakarta@arch.org',
157
+ 'иван.иванов@ccmns.org',
158
+ 'анна.петровна@eff.org',
159
+ 'поддержка@fsf.org',
160
+ 'контакт@opensource.org',
161
+ 'продажи@node.org',
162
+ 'пользователь@typescript.org',
163
+ 'разработчик@rpc.org',
164
+ 'alpha.beta@fullstack.org',
165
+ 'charlie.delta@mion.io',
166
+ 'test123@wiki.org',
167
+ 'mock.user@arch.org',
168
+ 'example.name@ccmns.org',
169
+ 'first.last@eff.org',
170
+ 'nickname@fsf.org',
171
+ 'alias@opensource.org',
172
+ 'temp.account@node.org',
173
+ 'demo.user@typescript.org',
174
+ 'email+tag@mion.io',
175
+ 'email-with-hyphen@rpc.org',
176
+ 'email_with_underscore@wiki.org',
177
+ 'very.common@arch.org',
178
+ "!#$%&'*+-/=?^_`{|}~@ccmns.org",
179
+ '"quoted"@eff.org',
180
+ '"very.(),:;<>[]\\"@opensource.org',
181
+ 'user.name+tag+sorting@example.com',
182
+ 'x@example.com',
183
+ 'example-indeed@strange-example.com',
184
+ 'test/test@test.com',
185
+ 'very."(),:;<>[]..very.unusual@strange.example.com',
186
+ 'user%example.com@mion.io',
187
+ 'user-@example.org'
188
+ ];
189
+ export type EMAIL_SAMPLES_PUNYCODE = [
190
+ 'john.doe@mion.io',
191
+ 'jane.smith@rpc.org',
192
+ 'admin@xn--e1afmkfd.xn--p1ai',
193
+ 'support@xn--80aaicww6a.xn--p1acf',
194
+ 'juan.perez@wiki.org',
195
+ 'maria.garcia@arch.org',
196
+ 'soporte@xn--mgbh0fb.xn--kgbechtv',
197
+ 'contacto@xn--fiqz9s.xn--fiqs8s',
198
+ 'иван.иванов@ccmns.org',
199
+ 'анна.петровна@xn--80adxhks.xn--p1ai',
200
+ 'поддержка@xn--d1acufc.xn--j1amh',
201
+ 'user.name+tag+sorting@example.com',
202
+ 'user@sub-domain.example-site.com',
203
+ 'user@domain.with-number123.com',
204
+ 'user@xn--80akhbyknj4f.xn--p1ai',
205
+ 'x@xn--mgberp4a5d4ar.xn--mgbaam7a8h',
206
+ 'test@xn--qxam.xn--zckzah',
207
+ 'info@xn--9n2bp8q.xn--9t4b11yi5a'
208
+ ];
209
+ export type URL_SAMPLES = [
210
+ 'https://mion.io',
211
+ 'https://rpc.org',
212
+ 'http://wiki.org',
213
+ 'https://www.mion.org',
214
+ 'http://www.api.org',
215
+ 'https://arch.org/path/to/resource',
216
+ 'http://ccmns.org/path/to/resource',
217
+ 'https://eff.org?query=param',
218
+ 'http://fsf.org?query=param#hello-world',
219
+ 'https://opensource.org#fragment',
220
+ 'http://node.org#fragment',
221
+ 'https://subdomain.typescript.org',
222
+ 'http://subdomain.rpc.org',
223
+ 'https://fullstack.org:8080',
224
+ 'http://localhost:8080/path/to/resource',
225
+ 'https://127.0.0.1:8080/path/to/resource',
226
+ 'https://254.60.167.80:80/path/to/resource',
227
+ 'http://:8080/path/to/resource',
228
+ 'http://[::1]:8080/path/to/resource',
229
+ 'http://[::]:8080/path/to/resource?query=param',
230
+ 'http://[::1]:8080/path/to/resource#fragment',
231
+ 'http://[::1]/path/to/resource',
232
+ 'ws://mion.io/socket',
233
+ 'ws://websocket.org/socket',
234
+ 'wss://socket.io/socket',
235
+ 'ws://live.com/socket?query=param',
236
+ 'wss://sock.org/socket?query=param#fragment',
237
+ 'ws://socketcluster.io/socket#fragment',
238
+ 'wss://developer..dev:8080/socket',
239
+ 'ws://fast.com:8080/socket?query=param',
240
+ 'ftp://example.com/file.txt',
241
+ 'ftps://example.com/file.txt'
242
+ ];
243
+ export type FILE_URL_SAMPLES = [
244
+ 'file:///path/to/file.txt',
245
+ 'file:///C:/path/to/file.txt',
246
+ 'file://localhost/path/to/file.txt',
247
+ 'file:///home/user/file.txt',
248
+ 'file://example.com/path/to/file.txt',
249
+ 'file:///C:/Users/User/Documents/file.txt',
250
+ 'file:///tmp/file.txt',
251
+ 'file:///var/log/syslog',
252
+ 'file:///path/to/file.txt?query=param',
253
+ 'file:///C:/path/to/file.txt?query=param',
254
+ 'file:///path/to/file%20with%20spaces.txt',
255
+ 'file:///path/to/file@with@special#characters.txt',
256
+ 'file://localhost/path/to/file.txt',
257
+ 'file://localhost/C:/path/to/file.txt',
258
+ 'file://localhost/home/user/file.txt',
259
+ 'file://127.0.0.1:890/example.com/path/to/file.txt',
260
+ 'file://localhost/path/to/file.txt?query=param',
261
+ 'file:///home/user/file.txt?query=param'
262
+ ];
263
+ export type HTTP_URL_SAMPLES = [
264
+ 'https://mion.io',
265
+ 'https://rpc.org',
266
+ 'http://wiki.org',
267
+ 'https://www.mion.org',
268
+ 'http://www.api.org',
269
+ 'https://arch.org/path/to/resource',
270
+ 'http://ccmns.org/path/to/resource',
271
+ 'https://eff.org?query=param',
272
+ 'http://fsf.org?query=param#hello-world',
273
+ 'https://opensource.org#fragment',
274
+ 'http://node.org#fragment',
275
+ 'https://subdomain.typescript.org',
276
+ 'http://subdomain.rpc.org',
277
+ 'https://fullstack.org:8080',
278
+ 'http://localhost:8080/path/to/resource',
279
+ 'https://127.0.0.1:8080/path/to/resource',
280
+ 'https://254.60.167.80:80/path/to/resource',
281
+ 'http://:8080/path/to/resource',
282
+ 'http://[::1]:8080/path/to/resource',
283
+ 'http://[::]:8080/path/to/resource?query=param',
284
+ 'http://[::1]:8080/path/to/resource#fragment',
285
+ 'http://[::1]/path/to/resource'
286
+ ];
287
+ export type SOCIAL_MEDIA_URL_SAMPLES = [
288
+ 'https://www.facebook.com/user',
289
+ 'https://twitter.com/user',
290
+ 'https://www.instagram.com/user/',
291
+ 'https://www.linkedin.com/in/user/',
292
+ 'https://www.tiktok.com/@user',
293
+ 'https://www.youtube.com/c/user',
294
+ 'https://www.snapchat.com/add/user',
295
+ 'https://www.pinterest.com/user?query=param',
296
+ 'https://www.reddit.com/user/user#fragment',
297
+ 'https://www.whatsapp.com/user/',
298
+ 'http://www.facebook.com/user',
299
+ 'http://twitter.com/user',
300
+ 'http://www.instagram.com/user/',
301
+ 'http://www.linkedin.com/in/user/?query=param',
302
+ 'http://www.tiktok.com/@user',
303
+ 'http://www.youtube.com/c/user',
304
+ 'http://www.snapchat.com/add/user?query=param#fragment',
305
+ 'http://www.pinterest.com/user/',
306
+ 'http://www.reddit.com/user/user/#fragment',
307
+ 'http://www.whatsapp.com/user/'
308
+ ];
309
+ export type SOCIAL_MEDIA_DOMAINS_SAMPLES = [
310
+ 'facebook',
311
+ 'twitter',
312
+ 'instagram',
313
+ 'linkedin',
314
+ 'tiktok',
315
+ 'youtube',
316
+ 'snapchat',
317
+ 'pinterest',
318
+ 'reddit',
319
+ 'whatsapp'
320
+ ];
321
+ export declare const TLD_SAMPLES: string[];
322
+ export declare const NAME_SAMPLES: string[];
323
+ export declare const TLD_CHARS = "abcdefghijklmnopqrstuvwxyz";
324
+ export declare const NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789";
325
+ export declare const NAME_CHARS_UNICODE: string;
326
+ export declare const INTERNET_PROTOCOLS: string[];
327
+ export declare const EMAIL_NAME_SAMPLES_ARRAY: string[];
328
+ export declare type __ΩEMAIL_NAME_SAMPLES = any[];
329
+ export declare type __ΩEMAIL_SAMPLES = any[];
330
+ export declare type __ΩEMAIL_SAMPLES_PUNYCODE = any[];
331
+ export declare type __ΩURL_SAMPLES = any[];
332
+ export declare type __ΩFILE_URL_SAMPLES = any[];
333
+ export declare type __ΩHTTP_URL_SAMPLES = any[];
334
+ export declare type __ΩSOCIAL_MEDIA_URL_SAMPLES = any[];
335
+ export declare type __ΩSOCIAL_MEDIA_DOMAINS_SAMPLES = any[];
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const src_number_numberFormat_runtype = require("./numberFormat.runtype.cjs");
4
+ const __ΩFormatInteger = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "integer", "integer", "FormatInteger", 'P."4#M.$o!#w%y'];
5
+ const __ΩFormatFloat = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "float", "float", "FormatFloat", 'P."4#M.$o!#w%y'];
6
+ const __ΩFormatPositive = [() => src_number_numberFormat_runtype.__ΩFormatNumber, 0, "min", "positive", "FormatPositive", 'P."4#M.$o!#w%y'];
7
+ const __ΩFormatNegative = [() => src_number_numberFormat_runtype.__ΩFormatNumber, 0, "max", "negative", "FormatNegative", 'P."4#M.$o!#w%y'];
8
+ const __ΩFormatPositiveInt = [() => src_number_numberFormat_runtype.__ΩFormatNumber, 0, "min", true, "integer", "positiveInt", "FormatPositiveInt", `P."4#.$4%M.&o!#w'y`];
9
+ const __ΩFormatNegativeInt = [() => src_number_numberFormat_runtype.__ΩFormatNumber, 0, "max", true, "integer", "negativeInt", "FormatNegativeInt", `P."4#.$4%M.&o!#w'y`];
10
+ const __ΩFormatInt8 = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "integer", -128, "min", 127, "max", "int8", "FormatInt8", `P."4#.$4%.&4'M.(o!#w)y`];
11
+ const __ΩFormatInt16 = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "integer", -32768, "min", 32767, "max", "int16", "FormatInt16", `P."4#.$4%.&4'M.(o!#w)y`];
12
+ const __ΩFormatInt32 = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "integer", -2147483648, "min", 2147483647, "max", "int32", "FormatInt32", `P."4#.$4%.&4'M.(o!#w)y`];
13
+ const __ΩFormatUInt8 = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "integer", 0, "min", 255, "max", "uint8", "FormatUInt8", `P."4#.$4%.&4'M.(o!#w)y`];
14
+ const __ΩFormatUInt16 = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "integer", 0, "min", 65535, "max", "uint16", "FormatUInt16", `P."4#.$4%.&4'M.(o!#w)y`];
15
+ const __ΩFormatUInt32 = [() => src_number_numberFormat_runtype.__ΩFormatNumber, true, "integer", 0, "min", 4294967295, "max", "uint32", "FormatUInt32", `P."4#.$4%.&4'M.(o!#w)y`];
16
+ exports.__ΩFormatFloat = __ΩFormatFloat;
17
+ exports.__ΩFormatInt16 = __ΩFormatInt16;
18
+ exports.__ΩFormatInt32 = __ΩFormatInt32;
19
+ exports.__ΩFormatInt8 = __ΩFormatInt8;
20
+ exports.__ΩFormatInteger = __ΩFormatInteger;
21
+ exports.__ΩFormatNegative = __ΩFormatNegative;
22
+ exports.__ΩFormatNegativeInt = __ΩFormatNegativeInt;
23
+ exports.__ΩFormatPositive = __ΩFormatPositive;
24
+ exports.__ΩFormatPositiveInt = __ΩFormatPositiveInt;
25
+ exports.__ΩFormatUInt16 = __ΩFormatUInt16;
26
+ exports.__ΩFormatUInt32 = __ΩFormatUInt32;
27
+ exports.__ΩFormatUInt8 = __ΩFormatUInt8;
28
+ //# sourceMappingURL=defaultNumberFormats.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultNumberFormats.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,63 @@
1
+ import { FormatNumber } from './numberFormat.runtype.ts';
2
+ export type FormatInteger = FormatNumber<{
3
+ integer: true;
4
+ }, 'integer'>;
5
+ export type FormatFloat = FormatNumber<{
6
+ float: true;
7
+ }, 'float'>;
8
+ export type FormatPositive = FormatNumber<{
9
+ min: 0;
10
+ }, 'positive'>;
11
+ export type FormatNegative = FormatNumber<{
12
+ max: 0;
13
+ }, 'negative'>;
14
+ export type FormatPositiveInt = FormatNumber<{
15
+ min: 0;
16
+ integer: true;
17
+ }, 'positiveInt'>;
18
+ export type FormatNegativeInt = FormatNumber<{
19
+ max: 0;
20
+ integer: true;
21
+ }, 'negativeInt'>;
22
+ export type FormatInt8 = FormatNumber<{
23
+ integer: true;
24
+ min: -128;
25
+ max: 127;
26
+ }, 'int8'>;
27
+ export type FormatInt16 = FormatNumber<{
28
+ integer: true;
29
+ min: -32768;
30
+ max: 32767;
31
+ }, 'int16'>;
32
+ export type FormatInt32 = FormatNumber<{
33
+ integer: true;
34
+ min: -2147483648;
35
+ max: 2147483647;
36
+ }, 'int32'>;
37
+ export type FormatUInt8 = FormatNumber<{
38
+ integer: true;
39
+ min: 0;
40
+ max: 255;
41
+ }, 'uint8'>;
42
+ export type FormatUInt16 = FormatNumber<{
43
+ integer: true;
44
+ min: 0;
45
+ max: 65535;
46
+ }, 'uint16'>;
47
+ export type FormatUInt32 = FormatNumber<{
48
+ integer: true;
49
+ min: 0;
50
+ max: 4294967295;
51
+ }, 'uint32'>;
52
+ export declare type __ΩFormatInteger = any[];
53
+ export declare type __ΩFormatFloat = any[];
54
+ export declare type __ΩFormatPositive = any[];
55
+ export declare type __ΩFormatNegative = any[];
56
+ export declare type __ΩFormatPositiveInt = any[];
57
+ export declare type __ΩFormatNegativeInt = any[];
58
+ export declare type __ΩFormatInt8 = any[];
59
+ export declare type __ΩFormatInt16 = any[];
60
+ export declare type __ΩFormatInt32 = any[];
61
+ export declare type __ΩFormatUInt8 = any[];
62
+ export declare type __ΩFormatUInt16 = any[];
63
+ export declare type __ΩFormatUInt32 = any[];
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const runTypes = require("@mionjs/run-types");
4
+ const type = require("@deepkit/type");
5
+ const src_utils = require("../utils.cjs");
6
+ class NumberRunTypeFormat extends runTypes.BaseRunTypeFormat {
7
+ static id = "numberFormat";
8
+ kind = type.ReflectionKind.number;
9
+ name = NumberRunTypeFormat.id;
10
+ emitIsType(comp, rt) {
11
+ const params = this.getParams(rt);
12
+ const v = comp.vλl;
13
+ const conditions = [];
14
+ if (params.integer) {
15
+ conditions.push(`Number.isInteger(${v})`);
16
+ } else if (params.float) {
17
+ conditions.push(`!Number.isInteger(${v})`);
18
+ }
19
+ if (params.max !== void 0) {
20
+ const maxVal = src_utils.paramVal(params.max);
21
+ conditions.push(`${v} <= ${maxVal}`);
22
+ }
23
+ if (params.min !== void 0) {
24
+ const minVal = src_utils.paramVal(params.min);
25
+ conditions.push(`${v} >= ${minVal}`);
26
+ }
27
+ if (params.lt !== void 0) {
28
+ const ltVal = src_utils.paramVal(params.lt);
29
+ conditions.push(`${v} < ${ltVal}`);
30
+ }
31
+ if (params.gt !== void 0) {
32
+ const gtVal = src_utils.paramVal(params.gt);
33
+ conditions.push(`${v} > ${gtVal}`);
34
+ }
35
+ if (params.multipleOf !== void 0) {
36
+ const multipleOfVal = src_utils.paramVal(params.multipleOf);
37
+ conditions.push(`(${v} % ${multipleOfVal} === 0)`);
38
+ }
39
+ return { code: conditions.join(" && "), type: "E" };
40
+ }
41
+ emitIsTypeErrors(comp, rt) {
42
+ const params = this.getParams(rt);
43
+ const v = comp.vλl;
44
+ const errFn = this.getCallJitFormatErr(comp, rt, this, false);
45
+ const conditions = [];
46
+ if (params.integer) {
47
+ conditions.push(`if (!Number.isInteger(${v})) ${errFn("integer", true)}`);
48
+ } else if (params.float) {
49
+ conditions.push(`if (Number.isInteger(${v})) ${errFn("float", true)}`);
50
+ }
51
+ if (params.max !== void 0) {
52
+ const maxVal = src_utils.paramVal(params.max);
53
+ conditions.push(`if (${v} > ${maxVal}) ${errFn("max", maxVal)}`);
54
+ }
55
+ if (params.min !== void 0) {
56
+ const minVal = src_utils.paramVal(params.min);
57
+ conditions.push(`if (${v} < ${minVal}) ${errFn("min", minVal)}`);
58
+ }
59
+ if (params.lt !== void 0) {
60
+ const ltVal = src_utils.paramVal(params.lt);
61
+ conditions.push(`if (${v} >= ${ltVal}) ${errFn("lt", ltVal)}`);
62
+ }
63
+ if (params.gt !== void 0) {
64
+ const gtVal = src_utils.paramVal(params.gt);
65
+ conditions.push(`if (${v} <= ${gtVal}) ${errFn("gt", gtVal)}`);
66
+ }
67
+ if (params.multipleOf !== void 0) {
68
+ const multipleOfVal = src_utils.paramVal(params.multipleOf);
69
+ conditions.push(`if ((${v} % ${multipleOfVal} !== 0)) ${errFn("multipleOf", multipleOfVal)}`);
70
+ }
71
+ return { code: conditions.join(";"), type: "S" };
72
+ }
73
+ // No format transformation needed for numbers
74
+ emitFormat() {
75
+ return { code: void 0, type: "S" };
76
+ }
77
+ emitToBinary(comp, rt) {
78
+ const type2 = "S";
79
+ const sεr = comp.args.sεr;
80
+ const params = this.getParams(rt);
81
+ const isFloat = params.float !== void 0 ? src_utils.paramVal(params.float) : false;
82
+ const floatCode = `${sεr}.view.setFloat64(${sεr}.index,${comp.vλl}, 1, (${sεr}.index += 8))`;
83
+ if (isFloat)
84
+ return { code: floatCode, type: type2 };
85
+ const isInt = params.integer !== void 0 ? src_utils.paramVal(params.integer) : false;
86
+ if (isInt) {
87
+ const { isUint8, isUint16, isUint32, isInt8, isInt16, isInt32 } = getIntegerType(params);
88
+ switch (true) {
89
+ case isUint8:
90
+ return { code: `${sεr}.view.setUint8(${sεr}.index++, ${comp.vλl})`, type: type2 };
91
+ case isUint16:
92
+ return { code: `${sεr}.view.setUint16(${sεr}.index, ${comp.vλl}, 1, ${sεr}.index += 2)`, type: type2 };
93
+ case isUint32:
94
+ return { code: `${sεr}.view.setUint32(${sεr}.index, ${comp.vλl}, 1, ${sεr}.index += 4)`, type: type2 };
95
+ case isInt8:
96
+ return { code: `${sεr}.view.setInt8(${sεr}.index++, ${comp.vλl})`, type: type2 };
97
+ case isInt16:
98
+ return { code: `${sεr}.view.setInt16(${sεr}.index, ${comp.vλl}, 1, ${sεr}.index += 2)`, type: type2 };
99
+ case isInt32:
100
+ return { code: `${sεr}.view.setInt32(${sεr}.index, ${comp.vλl}, 1, ${sεr}.index += 4)`, type: type2 };
101
+ default:
102
+ return { code: floatCode, type: type2 };
103
+ }
104
+ }
105
+ return { code: floatCode, type: "S" };
106
+ }
107
+ emitFromBinary(comp, rt) {
108
+ const type2 = "E";
109
+ const dεs = comp.args.dεs;
110
+ const params = this.getParams(rt);
111
+ const isFloat = params.float !== void 0 ? src_utils.paramVal(params.float) : false;
112
+ const floatCode = `${dεs}.view.getFloat64(${dεs}.index, 1, (${dεs}.index += 8))`;
113
+ if (isFloat)
114
+ return { code: floatCode, type: type2 };
115
+ const isInt = params.integer !== void 0 ? src_utils.paramVal(params.integer) : false;
116
+ if (isInt) {
117
+ const { isUint8, isUint16, isUint32, isInt8, isInt16, isInt32 } = getIntegerType(params);
118
+ switch (true) {
119
+ case isUint8:
120
+ return { code: `${dεs}.view.getUint8(${dεs}.index++)`, type: type2 };
121
+ case isUint16:
122
+ return { code: `${dεs}.view.getUint16(${dεs}.index, 1, ${dεs}.index += 2)`, type: type2 };
123
+ case isUint32:
124
+ return { code: `${dεs}.view.getUint32(${dεs}.index, 1, ${dεs}.index += 4)`, type: type2 };
125
+ case isInt8:
126
+ return { code: `${dεs}.view.getInt8(${dεs}.index++)`, type: type2 };
127
+ case isInt16:
128
+ return { code: `${dεs}.view.getInt16(${dεs}.index, 1, ${dεs}.index += 2)`, type: type2 };
129
+ case isInt32:
130
+ return { code: `${dεs}.view.getInt32(${dεs}.index, 1, ${dεs}.index += 4)`, type: type2 };
131
+ default:
132
+ return { code: floatCode, type: type2 };
133
+ }
134
+ }
135
+ return { code: floatCode, type: type2 };
136
+ }
137
+ _mock(opts, rt) {
138
+ const params = this.getParams(rt);
139
+ let min = params.min !== void 0 ? src_utils.paramVal(params.min) : -99999;
140
+ let max = params.max !== void 0 ? src_utils.paramVal(params.max) : 99999;
141
+ if (params.gt !== void 0) {
142
+ const epsilon = params.float ? 0.01 : 1;
143
+ const gtVal = src_utils.paramVal(params.gt);
144
+ min = Math.max(min, gtVal + epsilon);
145
+ }
146
+ if (params.lt !== void 0) {
147
+ const epsilon = params.float ? 0.01 : 1;
148
+ const ltVal = src_utils.paramVal(params.lt);
149
+ max = Math.min(max, ltVal - epsilon);
150
+ }
151
+ let result;
152
+ if (params.integer) {
153
+ min = Math.ceil(min);
154
+ max = Math.floor(max);
155
+ result = runTypes.random(min, max);
156
+ } else {
157
+ result = min + Math.random() * (max - min);
158
+ }
159
+ if (params.multipleOf !== void 0) {
160
+ const multipleOfVal = src_utils.paramVal(params.multipleOf);
161
+ const factor = Math.floor(result / multipleOfVal);
162
+ result = factor * multipleOfVal;
163
+ }
164
+ return result;
165
+ }
166
+ validateParams(rt, params) {
167
+ if (params.integer && params.float) {
168
+ throw new Error(`Cannot specify both integer and float in ${this.printPath(rt)}`);
169
+ }
170
+ const lowerBoundCount = [params.min, params.gt].filter(Boolean).length;
171
+ if (lowerBoundCount > 1) {
172
+ throw new Error(`Cannot specify more than one of min or gt in ${this.printPath(rt)}`);
173
+ }
174
+ const upperBoundCount = [params.max, params.lt].filter(Boolean).length;
175
+ if (upperBoundCount > 1) {
176
+ throw new Error(`Cannot specify more than one of max or lt in ${this.printPath(rt)}`);
177
+ }
178
+ if (params.min && params.max && src_utils.paramVal(params.min) > src_utils.paramVal(params.max)) {
179
+ throw new Error(`min cannot be greater than max in ${this.printPath(rt)}`);
180
+ }
181
+ if (params.gt && params.lt && src_utils.paramVal(params.gt) >= src_utils.paramVal(params.lt)) {
182
+ throw new Error(`gt cannot be greater than or equal to lt in ${this.printPath(rt)}`);
183
+ }
184
+ if (params.multipleOf !== void 0) {
185
+ const multipleOfVal = src_utils.paramVal(params.multipleOf);
186
+ if (multipleOfVal <= 0) {
187
+ throw new Error(`multipleOf must be greater than 0 in ${this.printPath(rt)}`);
188
+ }
189
+ if (!Number.isInteger(multipleOfVal)) {
190
+ throw new Error(`multipleOf must be an integer to avoid floating-point precision issues in ${this.printPath(rt)}`);
191
+ }
192
+ if (params.float) {
193
+ throw new Error(`multipleOf cannot be used with float constraint as multipleOf must be an integer in ${this.printPath(rt)}`);
194
+ }
195
+ }
196
+ }
197
+ }
198
+ function getIntegerType(params) {
199
+ const min = params.min !== void 0 ? src_utils.paramVal(params.min) : Number.MIN_SAFE_INTEGER;
200
+ const max = params.max !== void 0 ? src_utils.paramVal(params.max) : Number.MAX_SAFE_INTEGER;
201
+ const isUint8 = min >= 0 && max !== void 0 && max <= 255;
202
+ const isUint16 = min >= 0 && max !== void 0 && max <= 65535;
203
+ const isUint32 = min >= 0 && max !== void 0 && max <= 4294967295;
204
+ const isInt8 = min >= -128 && max !== void 0 && max <= 127;
205
+ const isInt16 = min >= -32768 && max !== void 0 && max <= 32767;
206
+ const isInt32 = min >= -2147483648 && max !== void 0 && max <= 2147483647;
207
+ return { isUint8, isUint16, isUint32, isInt8, isInt16, isInt32 };
208
+ }
209
+ const NUMBER_RUN_TYPE_FORMATTER = runTypes.registerFormatter(new NumberRunTypeFormat());
210
+ const __ΩFormatNumber = ["P", "BrandName", () => runTypes.__ΩTypeFormat, () => NumberRunTypeFormat.id, "FormatNumber", `b!!c"'i$e!!e!"o#%w%y`];
211
+ exports.NUMBER_RUN_TYPE_FORMATTER = NUMBER_RUN_TYPE_FORMATTER;
212
+ exports.NumberRunTypeFormat = NumberRunTypeFormat;
213
+ exports.__ΩFormatNumber = __ΩFormatNumber;
214
+ //# sourceMappingURL=numberFormat.runtype.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberFormat.runtype.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,21 @@
1
+ import { BaseRunType, JitFnCompiler, JitErrorsFnCompiler, JitCode, jitBinarySerializerArgs, JitFunctions, BaseFnCompiler, jitBinaryDeserializerArgs, TypeFormat, BaseRunTypeFormat, RunTypeOptions } from '@mionjs/run-types';
2
+ import { ReflectionKind } from '@deepkit/type';
3
+ import { FormatParams_Number } from '@mionjs/core';
4
+ type BinarySerializer = BaseFnCompiler<typeof jitBinarySerializerArgs, typeof JitFunctions.toBinary.id>;
5
+ type BinaryDeserializer = BaseFnCompiler<typeof jitBinaryDeserializerArgs, typeof JitFunctions.fromBinary.id>;
6
+ export declare class NumberRunTypeFormat extends BaseRunTypeFormat<FormatParams_Number> {
7
+ static readonly id: "numberFormat";
8
+ readonly kind = ReflectionKind.number;
9
+ readonly name: "numberFormat";
10
+ emitIsType(comp: JitFnCompiler, rt: BaseRunType): JitCode;
11
+ emitIsTypeErrors(comp: JitErrorsFnCompiler, rt: BaseRunType): JitCode;
12
+ emitFormat(): JitCode;
13
+ emitToBinary(comp: BinarySerializer, rt: BaseRunType): JitCode;
14
+ emitFromBinary(comp: BinaryDeserializer, rt: BaseRunType): JitCode;
15
+ _mock(opts: RunTypeOptions, rt: BaseRunType): number;
16
+ validateParams(rt: BaseRunType, params: FormatParams_Number): void;
17
+ }
18
+ export declare const NUMBER_RUN_TYPE_FORMATTER: NumberRunTypeFormat;
19
+ export type FormatNumber<P extends Partial<FormatParams_Number>, BrandName extends string = never> = TypeFormat<number, typeof NumberRunTypeFormat.id, P, BrandName>;
20
+ export {};
21
+ export declare type __ΩFormatNumber = any[];