@cjser/ts-pattern 5.9.0-cjser.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1776 -0
  3. package/dist/errors.d.cts +8 -0
  4. package/dist/errors.d.ts +8 -0
  5. package/dist/index.cjs +2 -0
  6. package/dist/index.cjs.map +1 -0
  7. package/dist/index.d.cts +5 -0
  8. package/dist/index.d.ts +5 -0
  9. package/dist/index.js +2 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/index.umd.js +2 -0
  12. package/dist/index.umd.js.map +1 -0
  13. package/dist/internals/helpers.d.cts +12 -0
  14. package/dist/internals/helpers.d.ts +12 -0
  15. package/dist/internals/symbols.d.cts +24 -0
  16. package/dist/internals/symbols.d.ts +24 -0
  17. package/dist/is-matching.d.cts +40 -0
  18. package/dist/is-matching.d.ts +40 -0
  19. package/dist/match.d.cts +19 -0
  20. package/dist/match.d.ts +19 -0
  21. package/dist/patterns.d.cts +345 -0
  22. package/dist/patterns.d.ts +345 -0
  23. package/dist/types/BuildMany.d.cts +22 -0
  24. package/dist/types/BuildMany.d.ts +22 -0
  25. package/dist/types/DeepExclude.d.cts +2 -0
  26. package/dist/types/DeepExclude.d.ts +2 -0
  27. package/dist/types/DistributeUnions.d.cts +111 -0
  28. package/dist/types/DistributeUnions.d.ts +111 -0
  29. package/dist/types/ExtractPreciseValue.d.cts +27 -0
  30. package/dist/types/ExtractPreciseValue.d.ts +27 -0
  31. package/dist/types/FindSelected.d.cts +78 -0
  32. package/dist/types/FindSelected.d.ts +78 -0
  33. package/dist/types/InvertPattern.d.cts +104 -0
  34. package/dist/types/InvertPattern.d.ts +104 -0
  35. package/dist/types/IsMatching.d.cts +13 -0
  36. package/dist/types/IsMatching.d.ts +13 -0
  37. package/dist/types/Match.d.cts +171 -0
  38. package/dist/types/Match.d.ts +171 -0
  39. package/dist/types/Pattern.d.cts +401 -0
  40. package/dist/types/Pattern.d.ts +401 -0
  41. package/dist/types/helpers.d.cts +80 -0
  42. package/dist/types/helpers.d.ts +80 -0
  43. package/dist/types/index.d.cts +1 -0
  44. package/dist/types/index.d.ts +1 -0
  45. package/dist-cjser/index.cjs +319 -0
  46. package/package.json +135 -0
@@ -0,0 +1,319 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // packages/@cjser/ts-pattern.tmp-26-1790099796053/dist/index.js
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ NonExhaustiveError: () => I,
23
+ P: () => z,
24
+ Pattern: () => z,
25
+ isMatching: () => u,
26
+ match: () => M
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+ var t = /* @__PURE__ */ Symbol.for("@ts-pattern/matcher");
30
+ var e = /* @__PURE__ */ Symbol.for("@ts-pattern/isVariadic");
31
+ var n = "@ts-pattern/anonymous-select-key";
32
+ var r = (t2) => Boolean(t2 && "object" == typeof t2);
33
+ var i = (e2) => e2 && !!e2[t];
34
+ var o = (n2, s2, c2) => {
35
+ if (i(n2)) {
36
+ const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2);
37
+ return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
38
+ }
39
+ if (r(n2)) {
40
+ if (!r(s2)) return false;
41
+ if (Array.isArray(n2)) {
42
+ if (!Array.isArray(s2)) return false;
43
+ let t2 = [], r2 = [], u2 = [];
44
+ for (const o2 of n2.keys()) {
45
+ const s3 = n2[o2];
46
+ i(s3) && s3[e] ? u2.push(s3) : u2.length ? r2.push(s3) : t2.push(s3);
47
+ }
48
+ if (u2.length) {
49
+ if (u2.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
50
+ if (s2.length < t2.length + r2.length) return false;
51
+ const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
52
+ return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === u2.length || o(u2[0], i2, c2));
53
+ }
54
+ return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2));
55
+ }
56
+ return Reflect.ownKeys(n2).every((e2) => {
57
+ const r2 = n2[e2];
58
+ return (e2 in s2 || i(u2 = r2) && "optional" === u2[t]().matcherType) && o(r2, s2[e2], c2);
59
+ var u2;
60
+ });
61
+ }
62
+ return Object.is(s2, n2);
63
+ };
64
+ var s = (e2) => {
65
+ var n2, o2, u2;
66
+ return r(e2) ? i(e2) ? null != (n2 = null == (o2 = (u2 = e2[t]()).getSelectionKeys) ? void 0 : o2.call(u2)) ? n2 : [] : Array.isArray(e2) ? c(e2, s) : c(Object.values(e2), s) : [];
67
+ };
68
+ var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
69
+ function u(...t2) {
70
+ if (1 === t2.length) {
71
+ const [e2] = t2;
72
+ return (t3) => o(e2, t3, () => {
73
+ });
74
+ }
75
+ if (2 === t2.length) {
76
+ const [e2, n2] = t2;
77
+ return o(e2, n2, () => {
78
+ });
79
+ }
80
+ throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
81
+ }
82
+ function a(t2) {
83
+ return Object.assign(t2, { optional: () => h(t2), and: (e2) => d(t2, e2), or: (e2) => y(t2, e2), select: (e2) => void 0 === e2 ? v(t2) : v(e2, t2) });
84
+ }
85
+ function l(t2) {
86
+ return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
87
+ let n2 = 0;
88
+ const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
89
+ return { next: () => {
90
+ var t4;
91
+ return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
92
+ } };
93
+ } }))(t2), { optional: () => l(h(t2)), select: (e2) => l(void 0 === e2 ? v(t2) : v(e2, t2)) });
94
+ }
95
+ function h(e2) {
96
+ return a({ [t]: () => ({ match: (t2) => {
97
+ let n2 = {};
98
+ const r2 = (t3, e3) => {
99
+ n2[t3] = e3;
100
+ };
101
+ return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 };
102
+ }, getSelectionKeys: () => s(e2), matcherType: "optional" }) });
103
+ }
104
+ var f = (t2, e2) => {
105
+ for (const n2 of t2) if (!e2(n2)) return false;
106
+ return true;
107
+ };
108
+ var g = (t2, e2) => {
109
+ for (const [n2, r2] of t2.entries()) if (!e2(r2, n2)) return false;
110
+ return true;
111
+ };
112
+ var m = (t2, e2) => {
113
+ const n2 = Reflect.ownKeys(t2);
114
+ for (const r2 of n2) if (!e2(r2, t2[r2])) return false;
115
+ return true;
116
+ };
117
+ function d(...e2) {
118
+ return a({ [t]: () => ({ match: (t2) => {
119
+ let n2 = {};
120
+ const r2 = (t3, e3) => {
121
+ n2[t3] = e3;
122
+ };
123
+ return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 };
124
+ }, getSelectionKeys: () => c(e2, s), matcherType: "and" }) });
125
+ }
126
+ function y(...e2) {
127
+ return a({ [t]: () => ({ match: (t2) => {
128
+ let n2 = {};
129
+ const r2 = (t3, e3) => {
130
+ n2[t3] = e3;
131
+ };
132
+ return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 };
133
+ }, getSelectionKeys: () => c(e2, s), matcherType: "or" }) });
134
+ }
135
+ function p(e2) {
136
+ return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
137
+ }
138
+ function v(...e2) {
139
+ const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
140
+ return a({ [t]: () => ({ match: (t2) => {
141
+ let e3 = { [null != r2 ? r2 : n]: t2 };
142
+ return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => {
143
+ e3[t3] = n2;
144
+ }), selections: e3 };
145
+ }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) });
146
+ }
147
+ function b(t2) {
148
+ return true;
149
+ }
150
+ function w(t2) {
151
+ return "number" == typeof t2;
152
+ }
153
+ function S(t2) {
154
+ return "string" == typeof t2;
155
+ }
156
+ function j(t2) {
157
+ return "bigint" == typeof t2;
158
+ }
159
+ var K = a(p(b));
160
+ var O = a(p(b));
161
+ var E = K;
162
+ var x = (t2) => Object.assign(a(t2), { startsWith: (e2) => {
163
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && t3.startsWith(n2)))));
164
+ var n2;
165
+ }, endsWith: (e2) => {
166
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && t3.endsWith(n2)))));
167
+ var n2;
168
+ }, minLength: (e2) => x(d(t2, ((t3) => p((e3) => S(e3) && e3.length >= t3))(e2))), length: (e2) => x(d(t2, ((t3) => p((e3) => S(e3) && e3.length === t3))(e2))), maxLength: (e2) => x(d(t2, ((t3) => p((e3) => S(e3) && e3.length <= t3))(e2))), includes: (e2) => {
169
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && t3.includes(n2)))));
170
+ var n2;
171
+ }, regex: (e2) => {
172
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && Boolean(t3.match(n2))))));
173
+ var n2;
174
+ } });
175
+ var A = x(p(S));
176
+ var N = (t2) => Object.assign(a(t2), { between: (e2, n2) => N(d(t2, ((t3, e3) => p((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 >= t3))(e2))), int: () => N(d(t2, p((t3) => w(t3) && Number.isInteger(t3)))), finite: () => N(d(t2, p((t3) => w(t3) && Number.isFinite(t3)))), positive: () => N(d(t2, p((t3) => w(t3) && t3 > 0))), negative: () => N(d(t2, p((t3) => w(t3) && t3 < 0))) });
177
+ var P = N(p(w));
178
+ var k = (t2) => Object.assign(a(t2), { between: (e2, n2) => k(d(t2, ((t3, e3) => p((n3) => j(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 < t3))(e2))), gt: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 > t3))(e2))), lte: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 <= t3))(e2))), gte: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 >= t3))(e2))), positive: () => k(d(t2, p((t3) => j(t3) && t3 > 0))), negative: () => k(d(t2, p((t3) => j(t3) && t3 < 0))) });
179
+ var T = k(p(j));
180
+ var B = a(p(function(t2) {
181
+ return "boolean" == typeof t2;
182
+ }));
183
+ var _ = a(p(function(t2) {
184
+ return "symbol" == typeof t2;
185
+ }));
186
+ var W = a(p(function(t2) {
187
+ return null == t2;
188
+ }));
189
+ var $ = a(p(function(t2) {
190
+ return null != t2;
191
+ }));
192
+ var z = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
193
+ return l({ [t]: () => ({ match: (t2) => {
194
+ if (!Array.isArray(t2)) return { matched: false };
195
+ if (0 === e2.length) return { matched: true };
196
+ const n2 = e2[0];
197
+ let r2 = {};
198
+ if (0 === t2.length) return s(n2).forEach((t3) => {
199
+ r2[t3] = [];
200
+ }), { matched: true, selections: r2 };
201
+ const i2 = (t3, e3) => {
202
+ r2[t3] = (r2[t3] || []).concat([e3]);
203
+ };
204
+ return { matched: t2.every((t3) => o(n2, t3, i2)), selections: r2 };
205
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
206
+ }, set: function(...e2) {
207
+ return a({ [t]: () => ({ match: (t2) => {
208
+ if (!(t2 instanceof Set)) return { matched: false };
209
+ let n2 = {};
210
+ if (0 === t2.size) return { matched: true, selections: n2 };
211
+ if (0 === e2.length) return { matched: true };
212
+ const r2 = (t3, e3) => {
213
+ n2[t3] = (n2[t3] || []).concat([e3]);
214
+ }, i2 = e2[0];
215
+ return { matched: f(t2, (t3) => o(i2, t3, r2)), selections: n2 };
216
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
217
+ }, map: function(...e2) {
218
+ return a({ [t]: () => ({ match: (t2) => {
219
+ if (!(t2 instanceof Map)) return { matched: false };
220
+ let n2 = {};
221
+ if (0 === t2.size) return { matched: true, selections: n2 };
222
+ const r2 = (t3, e3) => {
223
+ n2[t3] = (n2[t3] || []).concat([e3]);
224
+ };
225
+ if (0 === e2.length) return { matched: true };
226
+ var i2;
227
+ if (1 === e2.length) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
228
+ const [s2, c2] = e2;
229
+ return { matched: g(t2, (t3, e3) => {
230
+ const n3 = o(s2, e3, r2), i3 = o(c2, t3, r2);
231
+ return n3 && i3;
232
+ }), selections: n2 };
233
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
234
+ }, record: function(...e2) {
235
+ return a({ [t]: () => ({ match: (t2) => {
236
+ if (null === t2 || "object" != typeof t2 || Array.isArray(t2)) return { matched: false };
237
+ var n2;
238
+ if (0 === e2.length) throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${null == (n2 = e2[0]) ? void 0 : n2.toString()}`);
239
+ let r2 = {};
240
+ const i2 = (t3, e3) => {
241
+ r2[t3] = (r2[t3] || []).concat([e3]);
242
+ }, [s2, c2] = 1 === e2.length ? [A, e2[0]] : e2;
243
+ return { matched: m(t2, (t3, e3) => {
244
+ const n3 = "string" != typeof t3 || Number.isNaN(Number(t3)) ? null : Number(t3), r3 = null !== n3 && o(s2, n3, i2), u2 = o(s2, t3, i2), a2 = o(c2, e3, i2);
245
+ return (u2 || r3) && a2;
246
+ }), selections: r2 };
247
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
248
+ }, intersection: d, union: y, not: function(e2) {
249
+ return a({ [t]: () => ({ match: (t2) => ({ matched: !o(e2, t2, () => {
250
+ }) }), getSelectionKeys: () => [], matcherType: "not" }) });
251
+ }, when: p, select: v, any: K, unknown: O, _: E, string: A, number: P, bigint: T, boolean: B, symbol: _, nullish: W, nonNullable: $, instanceOf: function(t2) {
252
+ return a(p(/* @__PURE__ */ (function(t3) {
253
+ return (e2) => e2 instanceof t3;
254
+ })(t2)));
255
+ }, shape: function(t2) {
256
+ return a(p(u(t2)));
257
+ } };
258
+ var I = class extends Error {
259
+ constructor(t2) {
260
+ let e2;
261
+ try {
262
+ e2 = JSON.stringify(t2);
263
+ } catch (n2) {
264
+ e2 = t2;
265
+ }
266
+ super(`Pattern matching error: no pattern matches value ${e2}`), this.input = void 0, this.input = t2;
267
+ }
268
+ };
269
+ var L = { matched: false, value: void 0 };
270
+ function M(t2) {
271
+ return new R(t2, L);
272
+ }
273
+ var R = class _R {
274
+ constructor(t2, e2) {
275
+ this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
276
+ }
277
+ with(...t2) {
278
+ if (this.state.matched) return this;
279
+ const e2 = t2[t2.length - 1], r2 = [t2[0]];
280
+ let i2;
281
+ 3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
282
+ let s2 = false, c2 = {};
283
+ const u2 = (t3, e3) => {
284
+ s2 = true, c2[t3] = e3;
285
+ }, a2 = !r2.some((t3) => o(t3, this.input, u2)) || i2 && !Boolean(i2(this.input)) ? L : { matched: true, value: e2(s2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
286
+ return new _R(this.input, a2);
287
+ }
288
+ when(t2, e2) {
289
+ if (this.state.matched) return this;
290
+ const n2 = Boolean(t2(this.input));
291
+ return new _R(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : L);
292
+ }
293
+ otherwise(t2) {
294
+ return this.state.matched ? this.state.value : t2(this.input);
295
+ }
296
+ exhaustive(t2 = F) {
297
+ return this.state.matched ? this.state.value : t2(this.input);
298
+ }
299
+ run() {
300
+ return this.exhaustive();
301
+ }
302
+ returnType() {
303
+ return this;
304
+ }
305
+ narrow() {
306
+ return this;
307
+ }
308
+ };
309
+ function F(t2) {
310
+ throw new I(t2);
311
+ }
312
+ // Annotate the CommonJS export names for ESM import in node:
313
+ 0 && (module.exports = {
314
+ NonExhaustiveError,
315
+ P,
316
+ Pattern,
317
+ isMatching,
318
+ match
319
+ });
package/package.json ADDED
@@ -0,0 +1,135 @@
1
+ {
2
+ "name": "@cjser/ts-pattern",
3
+ "version": "5.9.0-cjser.2",
4
+ "description": " The exhaustive Pattern Matching library for TypeScript.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "source": "src/index.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "require": "./dist-cjser/index.cjs",
12
+ "import": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./types": {
19
+ "require": {
20
+ "types": "./dist/types/index.d.cts"
21
+ },
22
+ "import": {
23
+ "types": "./dist/types/index.d.ts"
24
+ },
25
+ "types": "./dist/types/index.d.ts"
26
+ },
27
+ "./package.json": "./package.json"
28
+ },
29
+ "types": "dist/index.d.ts",
30
+ "main": "./dist-cjser/index.cjs",
31
+ "module": "dist/index.js",
32
+ "unpkg": "dist/index.umd.js",
33
+ "scripts": {
34
+ "build": "rimraf dist && microbundle --format modern,cjs,umd && sh ./scripts/generate-cts.sh",
35
+ "dev": "microbundle watch",
36
+ "publish:jsr": "npm run prepublishOnly && npx jsr publish",
37
+ "release": "npm run prepublishOnly && npm publish && npx jsr publish",
38
+ "test": "jest",
39
+ "clear-test": "jest --clearCache",
40
+ "fmt": "prettier ./src/** ./tests/** -w",
41
+ "check": "tsc --strict --noEmit --extendedDiagnostics",
42
+ "perf": "tsc --project tests/tsconfig.json --noEmit --extendedDiagnostics",
43
+ "trace": "tsc --project tests/tsconfig.json --generateTrace trace --incremental false --noEmit",
44
+ "analyzeTrace": "npx @typescript/analyze-trace trace"
45
+ },
46
+ "files": [
47
+ "dist/**/*",
48
+ "package.json",
49
+ "dist-cjser"
50
+ ],
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://code.moenext.com/3rdeye/cjser.git"
54
+ },
55
+ "keywords": [
56
+ "pattern",
57
+ "matching",
58
+ "pattern-matching",
59
+ "typescript",
60
+ "match-with",
61
+ "match",
62
+ "switch",
63
+ "adt"
64
+ ],
65
+ "author": "Gabriel Vergnaud",
66
+ "license": "MIT",
67
+ "bugs": {
68
+ "url": "https://github.com/gvergnaud/ts-pattern/issues"
69
+ },
70
+ "homepage": "https://github.com/gvergnaud/ts-pattern#readme",
71
+ "devDependencies": {
72
+ "@types/jest": "^30.0.0",
73
+ "jest": "^30.1.3",
74
+ "microbundle": "^0.15.1",
75
+ "prettier": "^2.8.8",
76
+ "rimraf": "^5.0.1",
77
+ "ts-jest": "^29.4.1",
78
+ "typescript": "^5.9.2"
79
+ },
80
+ "cjser": {
81
+ "sourceVersion": "5.9.0",
82
+ "cjserVersion": 2,
83
+ "original": {
84
+ "name": "ts-pattern",
85
+ "version": "5.9.0",
86
+ "main": "dist/index.cjs",
87
+ "exports": {
88
+ ".": {
89
+ "require": {
90
+ "types": "./dist/index.d.cts",
91
+ "default": "./dist/index.cjs"
92
+ },
93
+ "import": {
94
+ "types": "./dist/index.d.ts",
95
+ "default": "./dist/index.js"
96
+ },
97
+ "types": "./dist/index.d.ts",
98
+ "default": "./dist/index.js"
99
+ },
100
+ "./types": {
101
+ "require": {
102
+ "types": "./dist/types/index.d.cts"
103
+ },
104
+ "import": {
105
+ "types": "./dist/types/index.d.ts"
106
+ },
107
+ "types": "./dist/types/index.d.ts"
108
+ },
109
+ "./package.json": "./package.json"
110
+ },
111
+ "repository": {
112
+ "type": "git",
113
+ "url": "git+ssh://git@github.com/gvergnaud/ts-pattern.git"
114
+ },
115
+ "files": [
116
+ "dist/**/*",
117
+ "package.json"
118
+ ],
119
+ "scripts": {
120
+ "build": "rimraf dist && microbundle --format modern,cjs,umd && sh ./scripts/generate-cts.sh",
121
+ "dev": "microbundle watch",
122
+ "prepublishOnly": "npm run test && npm run build",
123
+ "publish:jsr": "npm run prepublishOnly && npx jsr publish",
124
+ "release": "npm run prepublishOnly && npm publish && npx jsr publish",
125
+ "test": "jest",
126
+ "clear-test": "jest --clearCache",
127
+ "fmt": "prettier ./src/** ./tests/** -w",
128
+ "check": "tsc --strict --noEmit --extendedDiagnostics",
129
+ "perf": "tsc --project tests/tsconfig.json --noEmit --extendedDiagnostics",
130
+ "trace": "tsc --project tests/tsconfig.json --generateTrace trace --incremental false --noEmit",
131
+ "analyzeTrace": "npx @typescript/analyze-trace trace"
132
+ }
133
+ }
134
+ }
135
+ }