wellcrafted 0.15.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.
@@ -0,0 +1,509 @@
1
+ //#region src/result.d.ts
2
+ /**
3
+ * Represents the successful outcome of an operation, encapsulating the success value.
4
+ *
5
+ * This is the 'Ok' variant of the `Result` type. It holds a `data` property
6
+ * of type `T` (the success value) and an `error` property explicitly set to `null`,
7
+ * signifying no error occurred.
8
+ *
9
+ * Use this type in conjunction with `Err<E>` and `Result<T, E>`.
10
+ *
11
+ * @template T - The type of the success value contained within.
12
+ */
13
+ type Ok<T> = {
14
+ data: T;
15
+ error: null;
16
+ };
17
+ /**
18
+ * Represents the failure outcome of an operation, encapsulating the error value.
19
+ *
20
+ * This is the 'Err' variant of the `Result` type. It holds an `error` property
21
+ * of type `E` (the error value) and a `data` property explicitly set to `null`,
22
+ * signifying that no success value is present due to the failure.
23
+ *
24
+ * Use this type in conjunction with `Ok<T>` and `Result<T, E>`.
25
+ *
26
+ * @template E - The type of the error value contained within.
27
+ */
28
+ type Err<E> = {
29
+ error: E;
30
+ data: null;
31
+ };
32
+ /**
33
+ * A type that represents the outcome of an operation that can either succeed or fail.
34
+ *
35
+ * `Result<T, E>` is a discriminated union type with two possible variants:
36
+ * - `Ok<T>`: Represents a successful outcome, containing a `data` field with the success value of type `T`.
37
+ * In this case, the `error` field is `null`.
38
+ * - `Err<E>`: Represents a failure outcome, containing an `error` field with the error value of type `E`.
39
+ * In this case, the `data` field is `null`.
40
+ *
41
+ * This type promotes explicit error handling by requiring developers to check
42
+ * the variant of the `Result` before accessing its potential value or error.
43
+ * It helps avoid runtime errors often associated with implicit error handling (e.g., relying on `try-catch` for all errors).
44
+ *
45
+ * @template T - The type of the success value if the operation is successful (held in `Ok<T>`).
46
+ * @template E - The type of the error value if the operation fails (held in `Err<E>`).
47
+ * @example
48
+ * ```ts
49
+ * function divide(numerator: number, denominator: number): Result<number, string> {
50
+ * if (denominator === 0) {
51
+ * return Err("Cannot divide by zero");
52
+ * }
53
+ * return Ok(numerator / denominator);
54
+ * }
55
+ *
56
+ * const result1 = divide(10, 2);
57
+ * if (isOk(result1)) {
58
+ * console.log("Success:", result1.data); // Output: Success: 5
59
+ * }
60
+ *
61
+ * const result2 = divide(10, 0);
62
+ * if (isErr(result2)) {
63
+ * console.error("Failure:", result2.error); // Output: Failure: Cannot divide by zero
64
+ * }
65
+ * ```
66
+ */
67
+ type Result<T, E> = Ok<T> | Err<E>;
68
+ /**
69
+ * Constructs an `Ok<T>` variant, representing a successful outcome.
70
+ *
71
+ * This factory function creates the success variant of a `Result`.
72
+ * It wraps the provided `data` (the success value) and ensures the `error` property is `null`.
73
+ *
74
+ * @template T - The type of the success value.
75
+ * @param data - The success value to be wrapped in the `Ok` variant.
76
+ * @returns An `Ok<T>` object with the provided data and `error` set to `null`.
77
+ * @example
78
+ * ```ts
79
+ * const successfulResult = Ok("Operation completed successfully");
80
+ * // successfulResult is { data: "Operation completed successfully", error: null }
81
+ * ```
82
+ */
83
+ declare const Ok: <T>(data: T) => Ok<T>;
84
+ /**
85
+ * Constructs an `Err<E>` variant, representing a failure outcome.
86
+ *
87
+ * This factory function creates the error variant of a `Result`.
88
+ * It wraps the provided `error` (the error value) and ensures the `data` property is `null`.
89
+ *
90
+ * @template E - The type of the error value.
91
+ * @param error - The error value to be wrapped in the `Err` variant. This value represents the specific error that occurred.
92
+ * @returns An `Err<E>` object with the provided error and `data` set to `null`.
93
+ * @example
94
+ * ```ts
95
+ * const failedResult = Err(new TypeError("Invalid input"));
96
+ * // failedResult is { error: TypeError("Invalid input"), data: null }
97
+ * ```
98
+ */
99
+ declare const Err: <E>(error: E) => Err<E>;
100
+ /**
101
+ * Utility type to extract the `Ok<T>` variant from a `Result<T, E>` union type.
102
+ *
103
+ * If `R` is a `Result` type (e.g., `Result<string, Error>`), this type will resolve
104
+ * to `Ok<string>`. This can be useful in generic contexts or for type narrowing.
105
+ *
106
+ * @template R - The `Result<T, E>` union type from which to extract the `Ok<T>` variant.
107
+ * Must extend `Result<unknown, unknown>`.
108
+ */
109
+ type ExtractOkFromResult<R extends Result<unknown, unknown>> = Extract<R, {
110
+ error: null;
111
+ }>;
112
+ /**
113
+ * Utility type to extract the `Err<E>` variant from a `Result<T, E>` union type.
114
+ *
115
+ * If `R` is a `Result` type (e.g., `Result<string, Error>`), this type will resolve
116
+ * to `Err<Error>`. This can be useful in generic contexts or for type narrowing.
117
+ *
118
+ * @template R - The `Result<T, E>` union type from which to extract the `Err<E>` variant.
119
+ * Must extend `Result<unknown, unknown>`.
120
+ */
121
+ type ExtractErrFromResult<R extends Result<unknown, unknown>> = Extract<R, {
122
+ data: null;
123
+ }>;
124
+ /**
125
+ * Utility type to extract the success value's type `T` from a `Result<T, E>` type.
126
+ *
127
+ * If `R` is an `Ok<T>` variant (or a `Result<T, E>` that could be an `Ok<T>`),
128
+ * this type resolves to `T`. If `R` can only be an `Err<E>` variant, it resolves to `never`.
129
+ * This is useful for obtaining the type of the `data` field when you know you have a success.
130
+ *
131
+ * @template R - The `Result<T, E>` type from which to extract the success value's type.
132
+ * Must extend `Result<unknown, unknown>`.
133
+ * @example
134
+ * ```ts
135
+ * type MyResult = Result<number, string>;
136
+ * type SuccessValueType = UnwrapOk<MyResult>; // SuccessValueType is number
137
+ *
138
+ * type MyErrorResult = Err<string>;
139
+ * type ErrorValueType = UnwrapOk<MyErrorResult>; // ErrorValueType is never
140
+ * ```
141
+ */
142
+ type UnwrapOk<R extends Result<unknown, unknown>> = R extends Ok<infer U> ? U : never;
143
+ /**
144
+ * Utility type to extract the error value's type `E` from a `Result<T, E>` type.
145
+ *
146
+ * If `R` is an `Err<E>` variant (or a `Result<T, E>` that could be an `Err<E>`),
147
+ * this type resolves to `E`. If `R` can only be an `Ok<T>` variant, it resolves to `never`.
148
+ * This is useful for obtaining the type of the `error` field when you know you have a failure.
149
+ *
150
+ * @template R - The `Result<T, E>` type from which to extract the error value's type.
151
+ * Must extend `Result<unknown, unknown>`.
152
+ * @example
153
+ * ```ts
154
+ * type MyResult = Result<number, string>;
155
+ * type ErrorValueType = UnwrapErr<MyResult>; // ErrorValueType is string
156
+ *
157
+ * type MySuccessResult = Ok<number>;
158
+ * type SuccessValueType = UnwrapErr<MySuccessResult>; // SuccessValueType is never
159
+ * ```
160
+ */
161
+ type UnwrapErr<R extends Result<unknown, unknown>> = R extends Err<infer E> ? E : never;
162
+ /**
163
+ * Type guard to runtime check if an unknown value is a valid `Result<T, E>`.
164
+ *
165
+ * A value is considered a valid `Result` if:
166
+ * 1. It is a non-null object.
167
+ * 2. It has both `data` and `error` properties.
168
+ * 3. Exactly one of `data` or `error` is `null`. The other must be non-`null`.
169
+ *
170
+ * This function does not validate the types of `data` or `error` beyond `null` checks.
171
+ *
172
+ * @template T - The expected type of the success value if the value is an `Ok` variant (defaults to `unknown`).
173
+ * @template E - The expected type of the error value if the value is an `Err` variant (defaults to `unknown`).
174
+ * @param value - The value to check.
175
+ * @returns `true` if the value conforms to the `Result` structure, `false` otherwise.
176
+ * If `true`, TypeScript's type system will narrow `value` to `Result<T, E>`.
177
+ * @example
178
+ * ```ts
179
+ * declare const someValue: unknown;
180
+ *
181
+ * if (isResult<string, Error>(someValue)) {
182
+ * // someValue is now typed as Result<string, Error>
183
+ * if (isOk(someValue)) {
184
+ * console.log(someValue.data); // string
185
+ * } else {
186
+ * console.error(someValue.error); // Error
187
+ * }
188
+ * }
189
+ * ```
190
+ */
191
+ declare function isResult<T = unknown, E = unknown>(value: unknown): value is Result<T, E>;
192
+ /**
193
+ * Type guard to runtime check if a `Result<T, E>` is an `Ok<T>` variant.
194
+ *
195
+ * This function narrows the type of a `Result` to `Ok<T>` if it represents a successful outcome.
196
+ * An `Ok<T>` variant is identified by its `error` property being `null`.
197
+ *
198
+ * @template T - The success value type.
199
+ * @template E - The error value type.
200
+ * @param result - The `Result<T, E>` to check.
201
+ * @returns `true` if the `result` is an `Ok<T>` variant, `false` otherwise.
202
+ * If `true`, TypeScript's type system will narrow `result` to `Ok<T>`.
203
+ * @example
204
+ * ```ts
205
+ * declare const myResult: Result<number, string>;
206
+ *
207
+ * if (isOk(myResult)) {
208
+ * // myResult is now typed as Ok<number>
209
+ * console.log("Success value:", myResult.data); // myResult.data is number
210
+ * }
211
+ * ```
212
+ */
213
+ declare function isOk<T, E>(result: Result<T, E>): result is Ok<T>;
214
+ /**
215
+ * Type guard to runtime check if a `Result<T, E>` is an `Err<E>` variant.
216
+ *
217
+ * This function narrows the type of a `Result` to `Err<E>` if it represents a failure outcome.
218
+ * An `Err<E>` variant is identified by its `error` property being non-`null` (and thus `data` being `null`).
219
+ *
220
+ * @template T - The success value type.
221
+ * @template E - The error value type.
222
+ * @param result - The `Result<T, E>` to check.
223
+ * @returns `true` if the `result` is an `Err<E>` variant, `false` otherwise.
224
+ * If `true`, TypeScript's type system will narrow `result` to `Err<E>`.
225
+ * @example
226
+ * ```ts
227
+ * declare const myResult: Result<number, string>;
228
+ *
229
+ * if (isErr(myResult)) {
230
+ * // myResult is now typed as Err<string>
231
+ * console.error("Error value:", myResult.error); // myResult.error is string
232
+ * }
233
+ * ```
234
+ */
235
+ declare function isErr<T, E>(result: Result<T, E>): result is Err<E>;
236
+ /**
237
+ * Executes a synchronous operation and wraps its outcome (success or failure) in a `Result<T, E>`.
238
+ *
239
+ * This function attempts to execute the `operation`.
240
+ * - If `operation` completes successfully, its return value is wrapped in an `Ok<T>` variant.
241
+ * - If `operation` throws an exception, the caught exception (of type `unknown`) is passed to
242
+ * the `mapError` function. `mapError` is responsible for transforming this `unknown`
243
+ * exception into a well-typed error value of type `E`. This error value is then wrapped
244
+ * in an `Err<E>` variant.
245
+ *
246
+ * @template T - The type of the success value returned by the `operation` if it succeeds.
247
+ * @template E - The type of the error value produced by `mapError` if the `operation` fails.
248
+ * @param options - An object containing the operation and error mapping function.
249
+ * @param options.try - The synchronous operation to execute. This function is expected to return a value of type `T`.
250
+ * @param options.mapError - A function that takes the `unknown` exception caught from `options.try`
251
+ * and transforms it into a specific error value of type `E`. This function
252
+ * is crucial for creating a well-typed error for the `Err<E>` variant.
253
+ * @returns A `Result<T, E>`: `Ok<T>` if `options.try` succeeds, or `Err<E>` if it throws and `options.mapError` provides an error value.
254
+ * @example
255
+ * ```ts
256
+ * function parseJson(jsonString: string): Result<object, SyntaxError> {
257
+ * return trySync({
258
+ * try: () => JSON.parse(jsonString),
259
+ * mapError: (err: unknown) => {
260
+ * if (err instanceof SyntaxError) return err;
261
+ * return new SyntaxError("Unknown parsing error");
262
+ * }
263
+ * });
264
+ * }
265
+ *
266
+ * const validResult = parseJson('{"name":"Result"}'); // Ok<{name: string}>
267
+ * const invalidResult = parseJson('invalid json'); // Err<SyntaxError>
268
+ *
269
+ * if (isOk(validResult)) console.log(validResult.data);
270
+ * if (isErr(invalidResult)) console.error(invalidResult.error.message);
271
+ * ```
272
+ */
273
+ declare function trySync<T, E>({
274
+ try: operation,
275
+ mapError
276
+ }: {
277
+ try: () => T;
278
+ mapError: (error: unknown) => E;
279
+ }): Result<T, E>;
280
+ /**
281
+ * Executes an asynchronous operation (returning a `Promise`) and wraps its outcome in a `Promise<Result<T, E>>`.
282
+ *
283
+ * This function attempts to execute the asynchronous `operation`.
284
+ * - If the `Promise` returned by `operation` resolves successfully, its resolved value is wrapped in an `Ok<T>` variant.
285
+ * - If the `Promise` returned by `operation` rejects, or if `operation` itself throws an exception synchronously,
286
+ * the caught exception/rejection reason (of type `unknown`) is passed to the `mapError` function.
287
+ * `mapError` is responsible for transforming this `unknown` error into a well-typed error value of type `E`.
288
+ * This error value is then wrapped in an `Err<E>` variant.
289
+ *
290
+ * The entire outcome (`Ok<T>` or `Err<E>`) is wrapped in a `Promise`.
291
+ *
292
+ * @template T - The type of the success value the `Promise` from `operation` resolves to.
293
+ * @template E - The type of the error value produced by `mapError` if the `operation` fails or rejects.
294
+ * @param options - An object containing the asynchronous operation and error mapping function.
295
+ * @param options.try - The asynchronous operation to execute. This function must return a `Promise<T>`.
296
+ * @param options.mapError - A function that takes the `unknown` exception/rejection reason caught from `options.try`
297
+ * and transforms it into a specific error value of type `E`. This function
298
+ * is crucial for creating a well-typed error for the `Err<E>` variant.
299
+ * @returns A `Promise` that resolves to a `Result<T, E>`: `Ok<T>` if `options.try`'s `Promise` resolves,
300
+ * or `Err<E>` if it rejects/throws and `options.mapError` provides an error value.
301
+ * @example
302
+ * ```ts
303
+ * async function fetchData(url: string): Promise<Result<Response, Error>> {
304
+ * return tryAsync({
305
+ * try: async () => fetch(url),
306
+ * mapError: (err: unknown) => {
307
+ * if (err instanceof Error) return err;
308
+ * return new Error("Network request failed");
309
+ * }
310
+ * });
311
+ * }
312
+ *
313
+ * async function processData() {
314
+ * const result = await fetchData("/api/data");
315
+ * if (isOk(result)) {
316
+ * const response = result.data;
317
+ * console.log("Data fetched:", await response.json());
318
+ * } else {
319
+ * console.error("Fetch error:", result.error.message);
320
+ * }
321
+ * }
322
+ * processData();
323
+ * ```
324
+ */
325
+ declare function tryAsync<T, E>({
326
+ try: operation,
327
+ mapError
328
+ }: {
329
+ try: () => Promise<T>;
330
+ mapError: (error: unknown) => E;
331
+ }): Promise<Result<T, E>>;
332
+ /**
333
+ * Unwraps a value if it is a `Result`, otherwise returns the value itself.
334
+ *
335
+ * - If `value` is an `Ok<T>` variant, its `data` (the success value) is returned.
336
+ * - If `value` is an `Err<E>` variant, its `error` (the error value) is thrown.
337
+ * - If `value` is not a `Result` (i.e., it's already a plain value of type `T`),
338
+ * it is returned as-is.
339
+ *
340
+ * This function is useful for situations where an operation might return either a
341
+ * direct value or a `Result` wrapping a value/error, and you want to
342
+ * uniformly access the value or propagate the error via throwing.
343
+ *
344
+ * @template T - The type of the success value (if `value` is `Ok<T>`) or the type of the plain value.
345
+ * @template E - The type of the error value (if `value` is `Err<E>`).
346
+ * @param value - The value to unwrap. It can be a `Result<T, E>` or a plain value of type `T`.
347
+ * @returns The success value of type `T` if `value` is `Ok<T>` or if `value` is a plain `T`.
348
+ * @throws The error value `E` if `value` is an `Err<E>` variant.
349
+ *
350
+ * @example
351
+ * ```ts
352
+ * // Example with an Ok variant
353
+ * const okResult = Ok("success data");
354
+ * const unwrappedOk = unwrapIfResult(okResult); // "success data"
355
+ *
356
+ * // Example with an Err variant
357
+ * const errResult = Err(new Error("failure"));
358
+ * try {
359
+ * unwrapIfResult(errResult);
360
+ * } catch (e) {
361
+ * console.error(e.message); // "failure"
362
+ * }
363
+ *
364
+ * // Example with a plain value
365
+ * const plainValue = "plain data";
366
+ * const unwrappedPlain = unwrapIfResult(plainValue); // "plain data"
367
+ *
368
+ * // Example with a function that might return Result or plain value
369
+ * declare function mightReturnResult(): string | Result<string, Error>;
370
+ * const outcome = mightReturnResult();
371
+ * try {
372
+ * const finalValue = unwrapIfResult(outcome); // handles both cases
373
+ * console.log("Final value:", finalValue);
374
+ * } catch (e) {
375
+ * console.error("Operation failed:", e);
376
+ * }
377
+ * ```
378
+ */
379
+ declare function unwrapIfResult<T, E>(value: T | Result<T, E>): T;
380
+ //# sourceMappingURL=result.d.ts.map
381
+ //#endregion
382
+ //#region src/utils.d.ts
383
+ /**
384
+ * Partitions an array of Result objects into two separate arrays based on their status.
385
+ *
386
+ * @template T - The success type
387
+ * @template E - The error type
388
+ * @param results - An array of Result objects to partition
389
+ * @returns An object containing two arrays:
390
+ * - `oks`: Array of successful Result objects (Ok<T>[])
391
+ * - `errs`: Array of error Result objects (Err<E>[])
392
+ *
393
+ * @example
394
+ * const results = [Ok(1), Err("error"), Ok(2)];
395
+ * const { oks, errs } = partitionResults(results);
396
+ * // oks = [Ok(1), Ok(2)]
397
+ * // errs = [Err("error")]
398
+ */
399
+ declare function partitionResults<T, E>(results: Result<T, E>[]): {
400
+ oks: Ok<T>[];
401
+ errs: Err<E>[];
402
+ };
403
+ //# sourceMappingURL=utils.d.ts.map
404
+ //#endregion
405
+ //#region src/error/types.d.ts
406
+ type BaseError = Readonly<{
407
+ name: string;
408
+ message: string;
409
+ context: Record<string, unknown>;
410
+ cause: unknown;
411
+ }>;
412
+ /**
413
+ * Creates a tagged error type for type-safe error handling.
414
+ * Uses the `name` property as a discriminator for tagged unions.
415
+ *
416
+ * Error types should follow the convention of ending with "Error" suffix.
417
+ * The Err data structure wraps these error types in the Result system.
418
+ *
419
+ * @example
420
+ * ```ts
421
+ * type ValidationError = TaggedError<"ValidationError">
422
+ * type NetworkError = TaggedError<"NetworkError">
423
+ *
424
+ * function handleError(error: ValidationError | NetworkError) {
425
+ * switch (error.name) {
426
+ * case "ValidationError": // TypeScript knows this is ValidationError
427
+ * break;
428
+ * case "NetworkError": // TypeScript knows this is NetworkError
429
+ * break;
430
+ * }
431
+ * }
432
+ *
433
+ * // Used in Result types:
434
+ * function validate(input: string): Result<string, ValidationError> {
435
+ * if (!input) {
436
+ * return Err({
437
+ * name: "ValidationError",
438
+ * message: "Input is required",
439
+ * context: { input },
440
+ * cause: null,
441
+ * });
442
+ * }
443
+ * return Ok(input);
444
+ * }
445
+ * ```
446
+ */
447
+ type TaggedError<T extends string> = BaseError & {
448
+ readonly name: T;
449
+ };
450
+ declare function createTryFns<TName extends string>(name: TName): {
451
+ trySync: <T>({
452
+ try: operation,
453
+ mapErr
454
+ }: {
455
+ try: () => T;
456
+ mapErr: (error: unknown) => Omit<TaggedError<TName>, "name">;
457
+ }) => Result<T, TaggedError<TName>>;
458
+ tryAsync: <T>({
459
+ try: operation,
460
+ mapErr
461
+ }: {
462
+ try: () => Promise<T>;
463
+ mapErr: (error: unknown) => Omit<TaggedError<TName>, "name">;
464
+ }) => Promise<Result<T, TaggedError<TName>>>;
465
+ };
466
+ //# sourceMappingURL=types.d.ts.map
467
+ //#endregion
468
+ //#region src/error/utils.d.ts
469
+ /**
470
+ * Extracts a readable error message from an unknown error value
471
+ *
472
+ * This utility is commonly used in mapError functions when converting
473
+ * unknown errors to typed error objects in the Result system.
474
+ *
475
+ * @param error - The unknown error to extract a message from
476
+ * @returns A string representation of the error
477
+ *
478
+ * @example
479
+ * ```ts
480
+ * // With native Error
481
+ * const error = new Error("Something went wrong");
482
+ * const message = extractErrorMessage(error); // "Something went wrong"
483
+ *
484
+ * // With string error
485
+ * const stringError = "String error";
486
+ * const message2 = extractErrorMessage(stringError); // "String error"
487
+ *
488
+ * // With object error
489
+ * const unknownError = { code: 500, details: "Server error" };
490
+ * const message3 = extractErrorMessage(unknownError); // '{"code":500,"details":"Server error"}'
491
+ *
492
+ * // Used in mapError function
493
+ * const result = await tryAsync({
494
+ * try: () => riskyOperation(),
495
+ * mapError: (error): NetworkError => ({
496
+ * name: "NetworkError",
497
+ * message: extractErrorMessage(error),
498
+ * context: { operation: "riskyOperation" },
499
+ * cause: error,
500
+ * }),
501
+ * });
502
+ * ```
503
+ */
504
+ declare function extractErrorMessage(error: unknown): string;
505
+ //# sourceMappingURL=utils.d.ts.map
506
+
507
+ //#endregion
508
+ export { BaseError, Err, ExtractErrFromResult, ExtractOkFromResult, Ok, Result, TaggedError, UnwrapErr, UnwrapOk, createTryFns, extractErrorMessage, isErr, isOk, isResult, partitionResults, tryAsync, trySync, unwrapIfResult };
509
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/result.ts","../src/utils.ts","../src/error/types.ts","../src/error/utils.ts"],"sourcesContent":[],"mappings":";;AAWA;AAaA;AAqCA;;;;;;AAAsC;AAiBtC;AAAgE,KAnEpD,EAmEoD,CAAA,CAAA,CAAA,GAAA;EAAA,IAApC,EAnEA,CAmEA;EAAC,KAAM,EAAA,IAAA;CAAC;AAAF;AAiBlC;;;;;AAAqC;AAWrC;;;;AAAsE,KAlF1D,GAkF0D,CAAA,CAAA,CAAA,GAAA;EAAO,KAAA,EAlF/C,CAkF+C;EAcjE,IAAA,EAAA,IAAA;CAAoB;;;;AAA8C;AAuB9E;;;;;;AACI;AAqBJ;;;;;;AAGI;AAgCJ;;;;;AAEkB;AAuClB;;;;;;;AAA8D;AAyB9D;;;AAA8C,KA7MlC,MA6MkC,CAAA,CAAA,EAA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