typetify 2.0.0 → 2.2.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 (185) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +108 -0
  3. package/dist/async/index.js +1 -49
  4. package/dist/async/index.mjs +1 -4
  5. package/dist/chunk-272Z3AXV.js +1 -0
  6. package/dist/chunk-4HQERWI6.mjs +1 -0
  7. package/dist/chunk-4JG7CFRK.js +1 -0
  8. package/dist/chunk-5FBZYPQM.mjs +1 -0
  9. package/dist/chunk-5LWNMYHB.js +1 -0
  10. package/dist/chunk-5XQRYI2Q.mjs +1 -0
  11. package/dist/chunk-6HA2SN23.js +1 -0
  12. package/dist/chunk-6NWIIOHH.js +1 -0
  13. package/dist/chunk-7LBL6CYT.js +1 -0
  14. package/dist/chunk-7V3EDYJD.mjs +1 -0
  15. package/dist/chunk-B3R73UK5.mjs +1 -0
  16. package/dist/chunk-EAHFED6V.mjs +1 -0
  17. package/dist/chunk-EKSHS4DL.mjs +1 -0
  18. package/dist/chunk-FYQNKDT3.mjs +1 -0
  19. package/dist/chunk-GKOA3XGQ.js +1 -0
  20. package/dist/chunk-I4YSQ4HB.js +1 -0
  21. package/dist/chunk-JZXLCA2E.mjs +1 -0
  22. package/dist/chunk-M5OMYDI7.mjs +1 -0
  23. package/dist/chunk-MPY3WRLG.mjs +1 -0
  24. package/dist/chunk-MSOFO6QN.js +1 -0
  25. package/dist/chunk-NENRAPOL.mjs +1 -0
  26. package/dist/chunk-NOW4Q26G.mjs +1 -0
  27. package/dist/chunk-P4UNM7SF.js +1 -0
  28. package/dist/chunk-P5E2JDCX.mjs +1 -0
  29. package/dist/chunk-Q7SUL7MD.js +1 -0
  30. package/dist/chunk-QKNZICUO.mjs +1 -0
  31. package/dist/chunk-RHMANSTA.mjs +1 -0
  32. package/dist/chunk-SF64HETW.js +1 -0
  33. package/dist/chunk-T66YO63J.js +1 -0
  34. package/dist/chunk-TNK6EVQK.mjs +1 -0
  35. package/dist/chunk-TSJFKV3R.js +1 -0
  36. package/dist/chunk-TVCWWECJ.mjs +1 -0
  37. package/dist/chunk-W5I352FJ.js +1 -0
  38. package/dist/chunk-WAT4QJB2.js +1 -0
  39. package/dist/chunk-WCG5ODRX.mjs +1 -0
  40. package/dist/chunk-WDFIRO2J.js +1 -0
  41. package/dist/chunk-WOT6VMZA.js +1 -0
  42. package/dist/chunk-WQPSXQT5.js +1 -0
  43. package/dist/chunk-WS743BFA.js +1 -0
  44. package/dist/chunk-XPY5CWKZ.mjs +1 -0
  45. package/dist/collection/index.js +1 -125
  46. package/dist/collection/index.mjs +1 -4
  47. package/dist/core/index.js +1 -41
  48. package/dist/core/index.mjs +1 -4
  49. package/dist/decorator/index.js +1 -57
  50. package/dist/decorator/index.mjs +1 -4
  51. package/dist/dx/index.js +1 -53
  52. package/dist/dx/index.mjs +1 -4
  53. package/dist/flow/index.js +1 -50
  54. package/dist/flow/index.mjs +1 -5
  55. package/dist/fn/index.js +1 -37
  56. package/dist/fn/index.mjs +1 -4
  57. package/dist/guards/index.js +1 -233
  58. package/dist/guards/index.mjs +1 -4
  59. package/dist/index.d.mts +143 -24
  60. package/dist/index.d.ts +143 -24
  61. package/dist/index.js +3 -2498
  62. package/dist/index.mjs +3 -1537
  63. package/dist/input/index.js +1 -74
  64. package/dist/input/index.mjs +1 -5
  65. package/dist/iterator/index.js +1 -522
  66. package/dist/iterator/index.mjs +1 -502
  67. package/dist/logic/index.js +1 -416
  68. package/dist/logic/index.mjs +1 -367
  69. package/dist/math/index.js +1 -45
  70. package/dist/math/index.mjs +1 -4
  71. package/dist/narrowing/index.js +1 -220
  72. package/dist/narrowing/index.mjs +1 -186
  73. package/dist/object/index.js +1 -113
  74. package/dist/object/index.mjs +1 -4
  75. package/dist/result/index.js +1 -86
  76. package/dist/result/index.mjs +1 -5
  77. package/dist/schema/index.js +1 -410
  78. package/dist/schema/index.mjs +1 -384
  79. package/dist/string/index.js +1 -49
  80. package/dist/string/index.mjs +1 -4
  81. package/dist/typed/index.js +1 -193
  82. package/dist/typed/index.mjs +1 -4
  83. package/package.json +8 -3
  84. package/dist/async/index.js.map +0 -1
  85. package/dist/async/index.mjs.map +0 -1
  86. package/dist/chunk-2LJ6NZ6K.js +0 -108
  87. package/dist/chunk-2LJ6NZ6K.js.map +0 -1
  88. package/dist/chunk-4NXETABV.mjs +0 -116
  89. package/dist/chunk-4NXETABV.mjs.map +0 -1
  90. package/dist/chunk-6ZBTL74K.js +0 -129
  91. package/dist/chunk-6ZBTL74K.js.map +0 -1
  92. package/dist/chunk-CN3GYRJN.mjs +0 -137
  93. package/dist/chunk-CN3GYRJN.mjs.map +0 -1
  94. package/dist/chunk-CNTE6ZVH.js +0 -359
  95. package/dist/chunk-CNTE6ZVH.js.map +0 -1
  96. package/dist/chunk-DBENOSTA.js +0 -156
  97. package/dist/chunk-DBENOSTA.js.map +0 -1
  98. package/dist/chunk-DWIG5GF2.js +0 -135
  99. package/dist/chunk-DWIG5GF2.js.map +0 -1
  100. package/dist/chunk-EAUTTWTQ.mjs +0 -231
  101. package/dist/chunk-EAUTTWTQ.mjs.map +0 -1
  102. package/dist/chunk-FXWYPHA3.mjs +0 -13
  103. package/dist/chunk-FXWYPHA3.mjs.map +0 -1
  104. package/dist/chunk-GS3PP67B.js +0 -200
  105. package/dist/chunk-GS3PP67B.js.map +0 -1
  106. package/dist/chunk-IGA3VEZM.mjs +0 -503
  107. package/dist/chunk-IGA3VEZM.mjs.map +0 -1
  108. package/dist/chunk-J5LGTIGS.mjs +0 -9
  109. package/dist/chunk-J5LGTIGS.mjs.map +0 -1
  110. package/dist/chunk-JAOGY4JO.mjs +0 -1007
  111. package/dist/chunk-JAOGY4JO.mjs.map +0 -1
  112. package/dist/chunk-JB6UXRKD.mjs +0 -97
  113. package/dist/chunk-JB6UXRKD.mjs.map +0 -1
  114. package/dist/chunk-JQAQV75V.js +0 -561
  115. package/dist/chunk-JQAQV75V.js.map +0 -1
  116. package/dist/chunk-JQHUBZ4M.js +0 -88
  117. package/dist/chunk-JQHUBZ4M.js.map +0 -1
  118. package/dist/chunk-LT7JK7RJ.js +0 -87
  119. package/dist/chunk-LT7JK7RJ.js.map +0 -1
  120. package/dist/chunk-OEJK37LO.mjs +0 -328
  121. package/dist/chunk-OEJK37LO.mjs.map +0 -1
  122. package/dist/chunk-OPVES6W2.js +0 -16
  123. package/dist/chunk-OPVES6W2.js.map +0 -1
  124. package/dist/chunk-OWNUKWXV.js +0 -291
  125. package/dist/chunk-OWNUKWXV.js.map +0 -1
  126. package/dist/chunk-PQTXSQ4P.js +0 -369
  127. package/dist/chunk-PQTXSQ4P.js.map +0 -1
  128. package/dist/chunk-PZ5AY32C.js +0 -11
  129. package/dist/chunk-PZ5AY32C.js.map +0 -1
  130. package/dist/chunk-QFR7DVAJ.mjs +0 -63
  131. package/dist/chunk-QFR7DVAJ.mjs.map +0 -1
  132. package/dist/chunk-SGQNLTRK.js +0 -73
  133. package/dist/chunk-SGQNLTRK.js.map +0 -1
  134. package/dist/chunk-SIA5BSVY.js +0 -1054
  135. package/dist/chunk-SIA5BSVY.js.map +0 -1
  136. package/dist/chunk-SRDWUHDY.mjs +0 -188
  137. package/dist/chunk-SRDWUHDY.mjs.map +0 -1
  138. package/dist/chunk-TXU7NTT4.js +0 -249
  139. package/dist/chunk-TXU7NTT4.js.map +0 -1
  140. package/dist/chunk-TZEWREAC.mjs +0 -277
  141. package/dist/chunk-TZEWREAC.mjs.map +0 -1
  142. package/dist/chunk-V6CWFDIJ.mjs +0 -123
  143. package/dist/chunk-V6CWFDIJ.mjs.map +0 -1
  144. package/dist/chunk-YBJC5WMX.mjs +0 -341
  145. package/dist/chunk-YBJC5WMX.mjs.map +0 -1
  146. package/dist/chunk-YOPAXITF.mjs +0 -75
  147. package/dist/chunk-YOPAXITF.mjs.map +0 -1
  148. package/dist/chunk-ZE4FDBRI.mjs +0 -79
  149. package/dist/chunk-ZE4FDBRI.mjs.map +0 -1
  150. package/dist/collection/index.js.map +0 -1
  151. package/dist/collection/index.mjs.map +0 -1
  152. package/dist/core/index.js.map +0 -1
  153. package/dist/core/index.mjs.map +0 -1
  154. package/dist/decorator/index.js.map +0 -1
  155. package/dist/decorator/index.mjs.map +0 -1
  156. package/dist/dx/index.js.map +0 -1
  157. package/dist/dx/index.mjs.map +0 -1
  158. package/dist/flow/index.js.map +0 -1
  159. package/dist/flow/index.mjs.map +0 -1
  160. package/dist/fn/index.js.map +0 -1
  161. package/dist/fn/index.mjs.map +0 -1
  162. package/dist/guards/index.js.map +0 -1
  163. package/dist/guards/index.mjs.map +0 -1
  164. package/dist/index.js.map +0 -1
  165. package/dist/index.mjs.map +0 -1
  166. package/dist/input/index.js.map +0 -1
  167. package/dist/input/index.mjs.map +0 -1
  168. package/dist/iterator/index.js.map +0 -1
  169. package/dist/iterator/index.mjs.map +0 -1
  170. package/dist/logic/index.js.map +0 -1
  171. package/dist/logic/index.mjs.map +0 -1
  172. package/dist/math/index.js.map +0 -1
  173. package/dist/math/index.mjs.map +0 -1
  174. package/dist/narrowing/index.js.map +0 -1
  175. package/dist/narrowing/index.mjs.map +0 -1
  176. package/dist/object/index.js.map +0 -1
  177. package/dist/object/index.mjs.map +0 -1
  178. package/dist/result/index.js.map +0 -1
  179. package/dist/result/index.mjs.map +0 -1
  180. package/dist/schema/index.js.map +0 -1
  181. package/dist/schema/index.mjs.map +0 -1
  182. package/dist/string/index.js.map +0 -1
  183. package/dist/string/index.mjs.map +0 -1
  184. package/dist/typed/index.js.map +0 -1
  185. package/dist/typed/index.mjs.map +0 -1
@@ -1,384 +1 @@
1
- import { err, ok } from '../chunk-FXWYPHA3.mjs';
2
- import '../chunk-J5LGTIGS.mjs';
3
-
4
- // src/schema/base.ts
5
- function createSchema(tag, validate2) {
6
- const schema = {
7
- _type: void 0,
8
- _tag: tag,
9
- _validate: validate2,
10
- parse(value) {
11
- const result = this._validate(value, []);
12
- if (result.ok) {
13
- return result.value;
14
- }
15
- const errors = result.error;
16
- const message = errors.map(
17
- (e) => e.path.length > 0 ? `${e.path.join(".")}: ${e.message}` : e.message
18
- ).join("; ");
19
- throw new TypeError(`Validation failed: ${message}`);
20
- },
21
- safeParse(value) {
22
- return this._validate(value, []);
23
- },
24
- is(value) {
25
- return this._validate(value, []).ok;
26
- },
27
- optional() {
28
- return createSchema(
29
- `${tag} | undefined`,
30
- (value, path) => {
31
- if (value === void 0) {
32
- return ok(void 0);
33
- }
34
- return validate2(value, path);
35
- }
36
- );
37
- },
38
- nullable() {
39
- return createSchema(
40
- `${tag} | null`,
41
- (value, path) => {
42
- if (value === null) {
43
- return ok(null);
44
- }
45
- return validate2(value, path);
46
- }
47
- );
48
- },
49
- default(defaultValue) {
50
- return createSchema(
51
- tag,
52
- (value, path) => {
53
- if (value === void 0) {
54
- return ok(defaultValue);
55
- }
56
- return validate2(value, path);
57
- }
58
- );
59
- },
60
- transform(fn) {
61
- return createSchema(
62
- `transform(${tag})`,
63
- (value, path) => {
64
- const result = validate2(value, path);
65
- if (!result.ok) {
66
- return result;
67
- }
68
- try {
69
- return ok(fn(result.value));
70
- } catch (e) {
71
- return err([{
72
- path,
73
- message: e instanceof Error ? e.message : "Transform failed",
74
- expected: "valid transformation",
75
- received: String(value)
76
- }]);
77
- }
78
- }
79
- );
80
- },
81
- refine(predicate, message = "Refinement failed") {
82
- return createSchema(
83
- `refine(${tag})`,
84
- (value, path) => {
85
- const result = validate2(value, path);
86
- if (!result.ok) {
87
- return result;
88
- }
89
- if (!predicate(result.value)) {
90
- return err([{
91
- path,
92
- message,
93
- expected: "value passing refinement",
94
- received: String(value)
95
- }]);
96
- }
97
- return result;
98
- }
99
- );
100
- }
101
- };
102
- return schema;
103
- }
104
- function validationError(path, message, expected, received) {
105
- return {
106
- path,
107
- message,
108
- expected,
109
- received: typeof received === "object" ? JSON.stringify(received)?.slice(0, 50) ?? "object" : String(received)
110
- };
111
- }
112
-
113
- // src/schema/schemas.ts
114
- function string() {
115
- return createSchema("string", (value, path) => {
116
- if (typeof value === "string") {
117
- return ok(value);
118
- }
119
- return err([validationError(path, "Expected string", "string", value)]);
120
- });
121
- }
122
- function number() {
123
- return createSchema("number", (value, path) => {
124
- if (typeof value === "number" && !Number.isNaN(value)) {
125
- return ok(value);
126
- }
127
- return err([validationError(path, "Expected number", "number", value)]);
128
- });
129
- }
130
- function boolean() {
131
- return createSchema("boolean", (value, path) => {
132
- if (typeof value === "boolean") {
133
- return ok(value);
134
- }
135
- return err([validationError(path, "Expected boolean", "boolean", value)]);
136
- });
137
- }
138
- function literal(expected) {
139
- return createSchema(`literal(${JSON.stringify(expected)})`, (value, path) => {
140
- if (value === expected) {
141
- return ok(expected);
142
- }
143
- return err([validationError(path, `Expected ${JSON.stringify(expected)}`, String(expected), value)]);
144
- });
145
- }
146
- function array(itemSchema) {
147
- const impl = itemSchema;
148
- return createSchema(`array(${impl._tag})`, (value, path) => {
149
- if (!Array.isArray(value)) {
150
- return err([validationError(path, "Expected array", "array", value)]);
151
- }
152
- const results = [];
153
- const errors = [];
154
- for (let i = 0; i < value.length; i++) {
155
- const result = impl._validate(value[i], [...path, i]);
156
- if (result.ok) {
157
- results.push(result.value);
158
- } else {
159
- errors.push(...result.error);
160
- }
161
- }
162
- if (errors.length > 0) {
163
- return err(errors);
164
- }
165
- return ok(results);
166
- });
167
- }
168
- function object(shape) {
169
- const shapeEntries = Object.entries(shape);
170
- const tag = `object({ ${shapeEntries.map(([k, v]) => `${k}: ${v._tag}`).join(", ")} })`;
171
- return createSchema(tag, (value, path) => {
172
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
173
- return err([validationError(path, "Expected object", "object", value)]);
174
- }
175
- const obj = value;
176
- const result = {};
177
- const errors = [];
178
- for (const [key, schema] of shapeEntries) {
179
- const fieldResult = schema._validate(obj[key], [...path, key]);
180
- if (fieldResult.ok) {
181
- result[key] = fieldResult.value;
182
- } else {
183
- errors.push(...fieldResult.error);
184
- }
185
- }
186
- if (errors.length > 0) {
187
- return err(errors);
188
- }
189
- return ok(result);
190
- });
191
- }
192
- function optional(schema) {
193
- return schema.optional();
194
- }
195
- function nullable(schema) {
196
- return schema.nullable();
197
- }
198
- function union(schemas) {
199
- const impls = schemas;
200
- const tag = `union(${impls.map((s) => s._tag).join(" | ")})`;
201
- return createSchema(tag, (value, path) => {
202
- for (const schema of impls) {
203
- const result = schema._validate(value, path);
204
- if (result.ok) {
205
- return ok(result.value);
206
- }
207
- }
208
- return err([validationError(
209
- path,
210
- `Expected one of: ${impls.map((s) => s._tag).join(", ")}`,
211
- tag,
212
- value
213
- )]);
214
- });
215
- }
216
- function intersection(schemaA, schemaB) {
217
- const implA = schemaA;
218
- const implB = schemaB;
219
- const tag = `intersection(${implA._tag} & ${implB._tag})`;
220
- return createSchema(tag, (value, path) => {
221
- const resultA = implA._validate(value, path);
222
- if (!resultA.ok) {
223
- return resultA;
224
- }
225
- const resultB = implB._validate(value, path);
226
- if (!resultB.ok) {
227
- return resultB;
228
- }
229
- return ok({ ...resultA.value, ...resultB.value });
230
- });
231
- }
232
- function record(valueSchema) {
233
- const impl = valueSchema;
234
- const tag = `record(${impl._tag})`;
235
- return createSchema(tag, (value, path) => {
236
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
237
- return err([validationError(path, "Expected object", "object", value)]);
238
- }
239
- const obj = value;
240
- const result = {};
241
- const errors = [];
242
- for (const [key, val] of Object.entries(obj)) {
243
- const fieldResult = impl._validate(val, [...path, key]);
244
- if (fieldResult.ok) {
245
- result[key] = fieldResult.value;
246
- } else {
247
- errors.push(...fieldResult.error);
248
- }
249
- }
250
- if (errors.length > 0) {
251
- return err(errors);
252
- }
253
- return ok(result);
254
- });
255
- }
256
- function tuple(schemas) {
257
- const impls = schemas;
258
- const tag = `tuple([${impls.map((s) => s._tag).join(", ")}])`;
259
- return createSchema(tag, (value, path) => {
260
- if (!Array.isArray(value)) {
261
- return err([validationError(path, "Expected array", "array", value)]);
262
- }
263
- if (value.length !== impls.length) {
264
- return err([validationError(
265
- path,
266
- `Expected tuple of length ${impls.length}`,
267
- `[${impls.map((s) => s._tag).join(", ")}]`,
268
- value
269
- )]);
270
- }
271
- const results = [];
272
- const errors = [];
273
- for (let i = 0; i < impls.length; i++) {
274
- const result = impls[i]._validate(value[i], [...path, i]);
275
- if (result.ok) {
276
- results.push(result.value);
277
- } else {
278
- errors.push(...result.error);
279
- }
280
- }
281
- if (errors.length > 0) {
282
- return err(errors);
283
- }
284
- return ok(results);
285
- });
286
- }
287
- function unknown() {
288
- return createSchema("unknown", (value) => ok(value));
289
- }
290
- function any() {
291
- return createSchema("any", (value) => ok(value));
292
- }
293
- function date() {
294
- return createSchema("date", (value, path) => {
295
- if (value instanceof Date && !Number.isNaN(value.getTime())) {
296
- return ok(value);
297
- }
298
- if (typeof value === "string") {
299
- const parsed = new Date(value);
300
- if (!Number.isNaN(parsed.getTime())) {
301
- return ok(parsed);
302
- }
303
- }
304
- return err([validationError(path, "Expected valid date", "Date", value)]);
305
- });
306
- }
307
- function email() {
308
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
309
- return createSchema("email", (value, path) => {
310
- if (typeof value !== "string") {
311
- return err([validationError(path, "Expected string", "string", value)]);
312
- }
313
- if (!emailRegex.test(value)) {
314
- return err([validationError(path, "Expected valid email", "email", value)]);
315
- }
316
- return ok(value);
317
- });
318
- }
319
- function url() {
320
- return createSchema("url", (value, path) => {
321
- if (typeof value !== "string") {
322
- return err([validationError(path, "Expected string", "string", value)]);
323
- }
324
- try {
325
- new URL(value);
326
- return ok(value);
327
- } catch {
328
- return err([validationError(path, "Expected valid URL", "url", value)]);
329
- }
330
- });
331
- }
332
- function uuid() {
333
- const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
334
- return createSchema("uuid", (value, path) => {
335
- if (typeof value !== "string") {
336
- return err([validationError(path, "Expected string", "string", value)]);
337
- }
338
- if (!uuidRegex.test(value)) {
339
- return err([validationError(path, "Expected valid UUID", "uuid", value)]);
340
- }
341
- return ok(value);
342
- });
343
- }
344
-
345
- // src/schema/parse.ts
346
- function parse(schema, value) {
347
- return schema.parse(value);
348
- }
349
- function safeParse(schema, value) {
350
- return schema.safeParse(value);
351
- }
352
- function validate(schema, value) {
353
- const result = schema.safeParse(value);
354
- return result.ok ? [] : result.error;
355
- }
356
- function is(schema, value) {
357
- return schema.is(value);
358
- }
359
- function parseJson(schema, json) {
360
- try {
361
- const parsed = JSON.parse(json);
362
- return safeParse(schema, parsed);
363
- } catch (e) {
364
- return {
365
- ok: false,
366
- error: [{
367
- path: [],
368
- message: e instanceof Error ? e.message : "Invalid JSON",
369
- expected: "valid JSON",
370
- received: json.slice(0, 50)
371
- }]
372
- };
373
- }
374
- }
375
- function createGuard(schema) {
376
- return (value) => schema.is(value);
377
- }
378
- function createParser(schema) {
379
- return (value) => parse(schema, value);
380
- }
381
-
382
- export { any as anySchema, array, boolean, createGuard, createParser, date, email, intersection, is, literal, nullable, number, object, optional, parse, parseJson, record, safeParse, string, tuple, union, unknown as unknownSchema, url, uuid, validate };
383
- //# sourceMappingURL=index.mjs.map
384
- //# sourceMappingURL=index.mjs.map
1
+ export{n as anySchema,e as array,c as boolean,x as createGuard,y as createParser,o as date,p as email,j as intersection,v as is,d as literal,h as nullable,b as number,f as object,g as optional,s as parse,w as parseJson,k as record,t as safeParse,a as string,l as tuple,i as union,m as unknownSchema,q as url,r as uuid,u as validate}from'../chunk-RHMANSTA.mjs';import'../chunk-5FBZYPQM.mjs';import'../chunk-JZXLCA2E.mjs';
@@ -1,49 +1 @@
1
- 'use strict';
2
-
3
- var chunkLT7JK7RJ_js = require('../chunk-LT7JK7RJ.js');
4
- require('../chunk-PZ5AY32C.js');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "camelCase", {
9
- enumerable: true,
10
- get: function () { return chunkLT7JK7RJ_js.camelCase; }
11
- });
12
- Object.defineProperty(exports, "capitalize", {
13
- enumerable: true,
14
- get: function () { return chunkLT7JK7RJ_js.capitalize; }
15
- });
16
- Object.defineProperty(exports, "kebabCase", {
17
- enumerable: true,
18
- get: function () { return chunkLT7JK7RJ_js.kebabCase; }
19
- });
20
- Object.defineProperty(exports, "pascalCase", {
21
- enumerable: true,
22
- get: function () { return chunkLT7JK7RJ_js.pascalCase; }
23
- });
24
- Object.defineProperty(exports, "slugify", {
25
- enumerable: true,
26
- get: function () { return chunkLT7JK7RJ_js.slugify; }
27
- });
28
- Object.defineProperty(exports, "snakeCase", {
29
- enumerable: true,
30
- get: function () { return chunkLT7JK7RJ_js.snakeCase; }
31
- });
32
- Object.defineProperty(exports, "template", {
33
- enumerable: true,
34
- get: function () { return chunkLT7JK7RJ_js.template; }
35
- });
36
- Object.defineProperty(exports, "truncate", {
37
- enumerable: true,
38
- get: function () { return chunkLT7JK7RJ_js.truncate; }
39
- });
40
- Object.defineProperty(exports, "uncapitalize", {
41
- enumerable: true,
42
- get: function () { return chunkLT7JK7RJ_js.uncapitalize; }
43
- });
44
- Object.defineProperty(exports, "words", {
45
- enumerable: true,
46
- get: function () { return chunkLT7JK7RJ_js.words; }
47
- });
48
- //# sourceMappingURL=index.js.map
49
- //# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkWQPSXQT5_js=require('../chunk-WQPSXQT5.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"camelCase",{enumerable:true,get:function(){return chunkWQPSXQT5_js.c}});Object.defineProperty(exports,"capitalize",{enumerable:true,get:function(){return chunkWQPSXQT5_js.a}});Object.defineProperty(exports,"kebabCase",{enumerable:true,get:function(){return chunkWQPSXQT5_js.d}});Object.defineProperty(exports,"pascalCase",{enumerable:true,get:function(){return chunkWQPSXQT5_js.f}});Object.defineProperty(exports,"slugify",{enumerable:true,get:function(){return chunkWQPSXQT5_js.h}});Object.defineProperty(exports,"snakeCase",{enumerable:true,get:function(){return chunkWQPSXQT5_js.e}});Object.defineProperty(exports,"template",{enumerable:true,get:function(){return chunkWQPSXQT5_js.i}});Object.defineProperty(exports,"truncate",{enumerable:true,get:function(){return chunkWQPSXQT5_js.g}});Object.defineProperty(exports,"uncapitalize",{enumerable:true,get:function(){return chunkWQPSXQT5_js.b}});Object.defineProperty(exports,"words",{enumerable:true,get:function(){return chunkWQPSXQT5_js.j}});
@@ -1,4 +1 @@
1
- export { camelCase, capitalize, kebabCase, pascalCase, slugify, snakeCase, template, truncate, uncapitalize, words } from '../chunk-YOPAXITF.mjs';
2
- import '../chunk-J5LGTIGS.mjs';
3
- //# sourceMappingURL=index.mjs.map
4
- //# sourceMappingURL=index.mjs.map
1
+ export{c as camelCase,a as capitalize,d as kebabCase,f as pascalCase,h as slugify,e as snakeCase,i as template,g as truncate,b as uncapitalize,j as words}from'../chunk-FYQNKDT3.mjs';import'../chunk-JZXLCA2E.mjs';
@@ -1,193 +1 @@
1
- 'use strict';
2
-
3
- var chunkSIA5BSVY_js = require('../chunk-SIA5BSVY.js');
4
- require('../chunk-PZ5AY32C.js');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "assertTypeDebug", {
9
- enumerable: true,
10
- get: function () { return chunkSIA5BSVY_js.assertType; }
11
- });
12
- Object.defineProperty(exports, "asyncData", {
13
- enumerable: true,
14
- get: function () { return chunkSIA5BSVY_js.asyncData; }
15
- });
16
- Object.defineProperty(exports, "brand", {
17
- enumerable: true,
18
- get: function () { return chunkSIA5BSVY_js.brand; }
19
- });
20
- Object.defineProperty(exports, "collection", {
21
- enumerable: true,
22
- get: function () { return chunkSIA5BSVY_js.collection; }
23
- });
24
- Object.defineProperty(exports, "collectionWithId", {
25
- enumerable: true,
26
- get: function () { return chunkSIA5BSVY_js.collectionWithId; }
27
- });
28
- Object.defineProperty(exports, "createActions", {
29
- enumerable: true,
30
- get: function () { return chunkSIA5BSVY_js.createActions; }
31
- });
32
- Object.defineProperty(exports, "createBuilder", {
33
- enumerable: true,
34
- get: function () { return chunkSIA5BSVY_js.createBuilder; }
35
- });
36
- Object.defineProperty(exports, "createCollection", {
37
- enumerable: true,
38
- get: function () { return chunkSIA5BSVY_js.createCollection; }
39
- });
40
- Object.defineProperty(exports, "createMap", {
41
- enumerable: true,
42
- get: function () { return chunkSIA5BSVY_js.createMap; }
43
- });
44
- Object.defineProperty(exports, "createMatcher", {
45
- enumerable: true,
46
- get: function () { return chunkSIA5BSVY_js.createMatcher; }
47
- });
48
- Object.defineProperty(exports, "createReducer", {
49
- enumerable: true,
50
- get: function () { return chunkSIA5BSVY_js.createReducer; }
51
- });
52
- Object.defineProperty(exports, "createSet", {
53
- enumerable: true,
54
- get: function () { return chunkSIA5BSVY_js.createSet; }
55
- });
56
- Object.defineProperty(exports, "createTypedEmitter", {
57
- enumerable: true,
58
- get: function () { return chunkSIA5BSVY_js.createTypedEmitter; }
59
- });
60
- Object.defineProperty(exports, "deepMergeFn", {
61
- enumerable: true,
62
- get: function () { return chunkSIA5BSVY_js.deepMerge; }
63
- });
64
- Object.defineProperty(exports, "defineConst", {
65
- enumerable: true,
66
- get: function () { return chunkSIA5BSVY_js.defineConst; }
67
- });
68
- Object.defineProperty(exports, "defineEnum", {
69
- enumerable: true,
70
- get: function () { return chunkSIA5BSVY_js.defineEnum; }
71
- });
72
- Object.defineProperty(exports, "defineModel", {
73
- enumerable: true,
74
- get: function () { return chunkSIA5BSVY_js.defineModel; }
75
- });
76
- Object.defineProperty(exports, "defineStateMachine", {
77
- enumerable: true,
78
- get: function () { return chunkSIA5BSVY_js.defineStateMachine; }
79
- });
80
- Object.defineProperty(exports, "defineTuple", {
81
- enumerable: true,
82
- get: function () { return chunkSIA5BSVY_js.defineTuple; }
83
- });
84
- Object.defineProperty(exports, "formState", {
85
- enumerable: true,
86
- get: function () { return chunkSIA5BSVY_js.formState; }
87
- });
88
- Object.defineProperty(exports, "fromEntries", {
89
- enumerable: true,
90
- get: function () { return chunkSIA5BSVY_js.fromEntries; }
91
- });
92
- Object.defineProperty(exports, "identityTyped", {
93
- enumerable: true,
94
- get: function () { return chunkSIA5BSVY_js.identity; }
95
- });
96
- Object.defineProperty(exports, "impossible", {
97
- enumerable: true,
98
- get: function () { return chunkSIA5BSVY_js.impossible; }
99
- });
100
- Object.defineProperty(exports, "mapKeys", {
101
- enumerable: true,
102
- get: function () { return chunkSIA5BSVY_js.mapKeys; }
103
- });
104
- Object.defineProperty(exports, "mapValues", {
105
- enumerable: true,
106
- get: function () { return chunkSIA5BSVY_js.mapValues; }
107
- });
108
- Object.defineProperty(exports, "match", {
109
- enumerable: true,
110
- get: function () { return chunkSIA5BSVY_js.match; }
111
- });
112
- Object.defineProperty(exports, "matchUnion", {
113
- enumerable: true,
114
- get: function () { return chunkSIA5BSVY_js.matchUnion; }
115
- });
116
- Object.defineProperty(exports, "matchValue", {
117
- enumerable: true,
118
- get: function () { return chunkSIA5BSVY_js.matchValue; }
119
- });
120
- Object.defineProperty(exports, "merge", {
121
- enumerable: true,
122
- get: function () { return chunkSIA5BSVY_js.merge; }
123
- });
124
- Object.defineProperty(exports, "mergeAllFn", {
125
- enumerable: true,
126
- get: function () { return chunkSIA5BSVY_js.mergeAll; }
127
- });
128
- Object.defineProperty(exports, "mergeModels", {
129
- enumerable: true,
130
- get: function () { return chunkSIA5BSVY_js.mergeModels; }
131
- });
132
- Object.defineProperty(exports, "mergeWith", {
133
- enumerable: true,
134
- get: function () { return chunkSIA5BSVY_js.mergeWith; }
135
- });
136
- Object.defineProperty(exports, "modalState", {
137
- enumerable: true,
138
- get: function () { return chunkSIA5BSVY_js.modalState; }
139
- });
140
- Object.defineProperty(exports, "model", {
141
- enumerable: true,
142
- get: function () { return chunkSIA5BSVY_js.model; }
143
- });
144
- Object.defineProperty(exports, "narrow", {
145
- enumerable: true,
146
- get: function () { return chunkSIA5BSVY_js.narrow; }
147
- });
148
- Object.defineProperty(exports, "narrowTyped", {
149
- enumerable: true,
150
- get: function () { return chunkSIA5BSVY_js.narrow2; }
151
- });
152
- Object.defineProperty(exports, "omitModel", {
153
- enumerable: true,
154
- get: function () { return chunkSIA5BSVY_js.omitModel; }
155
- });
156
- Object.defineProperty(exports, "omitTyped", {
157
- enumerable: true,
158
- get: function () { return chunkSIA5BSVY_js.omit; }
159
- });
160
- Object.defineProperty(exports, "persistentCollection", {
161
- enumerable: true,
162
- get: function () { return chunkSIA5BSVY_js.persistentCollection; }
163
- });
164
- Object.defineProperty(exports, "pickModel", {
165
- enumerable: true,
166
- get: function () { return chunkSIA5BSVY_js.pickModel; }
167
- });
168
- Object.defineProperty(exports, "pickTyped", {
169
- enumerable: true,
170
- get: function () { return chunkSIA5BSVY_js.pick; }
171
- });
172
- Object.defineProperty(exports, "renameKeys", {
173
- enumerable: true,
174
- get: function () { return chunkSIA5BSVY_js.renameKeys; }
175
- });
176
- Object.defineProperty(exports, "showType", {
177
- enumerable: true,
178
- get: function () { return chunkSIA5BSVY_js.showType; }
179
- });
180
- Object.defineProperty(exports, "t", {
181
- enumerable: true,
182
- get: function () { return chunkSIA5BSVY_js.t; }
183
- });
184
- Object.defineProperty(exports, "undoable", {
185
- enumerable: true,
186
- get: function () { return chunkSIA5BSVY_js.undoable; }
187
- });
188
- Object.defineProperty(exports, "v", {
189
- enumerable: true,
190
- get: function () { return chunkSIA5BSVY_js.v; }
191
- });
192
- //# sourceMappingURL=index.js.map
193
- //# sourceMappingURL=index.js.map
1
+ 'use strict';var chunk6NWIIOHH_js=require('../chunk-6NWIIOHH.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"assertTypeDebug",{enumerable:true,get:function(){return chunk6NWIIOHH_js.G}});Object.defineProperty(exports,"asyncData",{enumerable:true,get:function(){return chunk6NWIIOHH_js.x}});Object.defineProperty(exports,"brand",{enumerable:true,get:function(){return chunk6NWIIOHH_js.f}});Object.defineProperty(exports,"collection",{enumerable:true,get:function(){return chunk6NWIIOHH_js.t}});Object.defineProperty(exports,"collectionWithId",{enumerable:true,get:function(){return chunk6NWIIOHH_js.u}});Object.defineProperty(exports,"createActions",{enumerable:true,get:function(){return chunk6NWIIOHH_js.j}});Object.defineProperty(exports,"createBuilder",{enumerable:true,get:function(){return chunk6NWIIOHH_js.h}});Object.defineProperty(exports,"createCollection",{enumerable:true,get:function(){return chunk6NWIIOHH_js.w}});Object.defineProperty(exports,"createMap",{enumerable:true,get:function(){return chunk6NWIIOHH_js.d}});Object.defineProperty(exports,"createMatcher",{enumerable:true,get:function(){return chunk6NWIIOHH_js.E}});Object.defineProperty(exports,"createReducer",{enumerable:true,get:function(){return chunk6NWIIOHH_js.l}});Object.defineProperty(exports,"createSet",{enumerable:true,get:function(){return chunk6NWIIOHH_js.e}});Object.defineProperty(exports,"createTypedEmitter",{enumerable:true,get:function(){return chunk6NWIIOHH_js.k}});Object.defineProperty(exports,"deepMergeFn",{enumerable:true,get:function(){return chunk6NWIIOHH_js.M}});Object.defineProperty(exports,"defineConst",{enumerable:true,get:function(){return chunk6NWIIOHH_js.a}});Object.defineProperty(exports,"defineEnum",{enumerable:true,get:function(){return chunk6NWIIOHH_js.b}});Object.defineProperty(exports,"defineModel",{enumerable:true,get:function(){return chunk6NWIIOHH_js.n}});Object.defineProperty(exports,"defineStateMachine",{enumerable:true,get:function(){return chunk6NWIIOHH_js.i}});Object.defineProperty(exports,"defineTuple",{enumerable:true,get:function(){return chunk6NWIIOHH_js.c}});Object.defineProperty(exports,"formState",{enumerable:true,get:function(){return chunk6NWIIOHH_js.y}});Object.defineProperty(exports,"fromEntries",{enumerable:true,get:function(){return chunk6NWIIOHH_js.R}});Object.defineProperty(exports,"identityTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.I}});Object.defineProperty(exports,"impossible",{enumerable:true,get:function(){return chunk6NWIIOHH_js.H}});Object.defineProperty(exports,"mapKeys",{enumerable:true,get:function(){return chunk6NWIIOHH_js.T}});Object.defineProperty(exports,"mapValues",{enumerable:true,get:function(){return chunk6NWIIOHH_js.S}});Object.defineProperty(exports,"match",{enumerable:true,get:function(){return chunk6NWIIOHH_js.B}});Object.defineProperty(exports,"matchUnion",{enumerable:true,get:function(){return chunk6NWIIOHH_js.D}});Object.defineProperty(exports,"matchValue",{enumerable:true,get:function(){return chunk6NWIIOHH_js.C}});Object.defineProperty(exports,"merge",{enumerable:true,get:function(){return chunk6NWIIOHH_js.K}});Object.defineProperty(exports,"mergeAllFn",{enumerable:true,get:function(){return chunk6NWIIOHH_js.L}});Object.defineProperty(exports,"mergeModels",{enumerable:true,get:function(){return chunk6NWIIOHH_js.p}});Object.defineProperty(exports,"mergeWith",{enumerable:true,get:function(){return chunk6NWIIOHH_js.N}});Object.defineProperty(exports,"modalState",{enumerable:true,get:function(){return chunk6NWIIOHH_js.z}});Object.defineProperty(exports,"model",{enumerable:true,get:function(){return chunk6NWIIOHH_js.o}});Object.defineProperty(exports,"narrow",{enumerable:true,get:function(){return chunk6NWIIOHH_js.g}});Object.defineProperty(exports,"narrowTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.J}});Object.defineProperty(exports,"omitModel",{enumerable:true,get:function(){return chunk6NWIIOHH_js.r}});Object.defineProperty(exports,"omitTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.P}});Object.defineProperty(exports,"persistentCollection",{enumerable:true,get:function(){return chunk6NWIIOHH_js.v}});Object.defineProperty(exports,"pickModel",{enumerable:true,get:function(){return chunk6NWIIOHH_js.q}});Object.defineProperty(exports,"pickTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.O}});Object.defineProperty(exports,"renameKeys",{enumerable:true,get:function(){return chunk6NWIIOHH_js.Q}});Object.defineProperty(exports,"showType",{enumerable:true,get:function(){return chunk6NWIIOHH_js.F}});Object.defineProperty(exports,"t",{enumerable:true,get:function(){return chunk6NWIIOHH_js.m}});Object.defineProperty(exports,"undoable",{enumerable:true,get:function(){return chunk6NWIIOHH_js.A}});Object.defineProperty(exports,"v",{enumerable:true,get:function(){return chunk6NWIIOHH_js.s}});
@@ -1,4 +1 @@
1
- export { assertType as assertTypeDebug, asyncData, brand, collection, collectionWithId, createActions, createBuilder, createCollection, createMap, createMatcher, createReducer, createSet, createTypedEmitter, deepMerge as deepMergeFn, defineConst, defineEnum, defineModel, defineStateMachine, defineTuple, formState, fromEntries, identity as identityTyped, impossible, mapKeys, mapValues, match, matchUnion, matchValue, merge, mergeAll as mergeAllFn, mergeModels, mergeWith, modalState, model, narrow, narrow2 as narrowTyped, omitModel, omit as omitTyped, persistentCollection, pickModel, pick as pickTyped, renameKeys, showType, t, undoable, v } from '../chunk-JAOGY4JO.mjs';
2
- import '../chunk-J5LGTIGS.mjs';
3
- //# sourceMappingURL=index.mjs.map
4
- //# sourceMappingURL=index.mjs.map
1
+ export{G as assertTypeDebug,x as asyncData,f as brand,t as collection,u as collectionWithId,j as createActions,h as createBuilder,w as createCollection,d as createMap,E as createMatcher,l as createReducer,e as createSet,k as createTypedEmitter,M as deepMergeFn,a as defineConst,b as defineEnum,n as defineModel,i as defineStateMachine,c as defineTuple,y as formState,R as fromEntries,I as identityTyped,H as impossible,T as mapKeys,S as mapValues,B as match,D as matchUnion,C as matchValue,K as merge,L as mergeAllFn,p as mergeModels,N as mergeWith,z as modalState,o as model,g as narrow,J as narrowTyped,r as omitModel,P as omitTyped,v as persistentCollection,q as pickModel,O as pickTyped,Q as renameKeys,F as showType,m as t,A as undoable,s as v}from'../chunk-M5OMYDI7.mjs';import'../chunk-JZXLCA2E.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typetify",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Runtime TypeScript helpers - like Lodash, but TS-first",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -103,7 +103,10 @@
103
103
  }
104
104
  },
105
105
  "files": [
106
- "dist"
106
+ "dist",
107
+ "README.md",
108
+ "CHANGELOG.md",
109
+ "LICENSE"
107
110
  ],
108
111
  "scripts": {
109
112
  "build": "tsup",
@@ -113,7 +116,9 @@
113
116
  "typecheck": "tsc --noEmit",
114
117
  "lint": "eslint src --ext .ts",
115
118
  "prepublishOnly": "npm run typecheck && npm run test && npm run build",
116
- "prepare": "npm run build"
119
+ "prepare": "npm run build",
120
+ "analyze": "npm pack --dry-run",
121
+ "size": "npm pack && tar -xvzf *.tgz && du -sh package && rm -rf package *.tgz"
117
122
  },
118
123
  "publishConfig": {
119
124
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}