rsult 1.3.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/result.d.ts DELETED
@@ -1,410 +0,0 @@
1
- import { Option } from './option';
2
- export type Result<T, E> = ResultOk<T, E> | ResultErr<T, E>;
3
- export interface IResultCore<T, E> {
4
- /**
5
- * Checks if the result is an instance of `ResultOk`.
6
- * @returns true if the result is `ResultOk`, otherwise false.
7
- *
8
- * Usage Example:
9
- * const result = Ok(5);
10
- * if (result.is_ok()) {
11
- * console.log("Result is Ok");
12
- * }
13
- */
14
- is_ok(): this is ResultOk<T, E>;
15
- /**
16
- * Checks if the result is an instance of `ResultErr`.
17
- * @returns true if the result is `ResultErr`, otherwise false.
18
- *
19
- * Usage Example:
20
- * const result = Err(new Error("Error"));
21
- * if (result.is_err()) {
22
- * console.log("Result is Err");
23
- * }
24
- */
25
- is_err(): this is ResultErr<T, E>;
26
- /**
27
- * Retrieves the value from `ResultOk`, wrapped in an `Option`.
28
- * @returns `Some` containing the value if the result is `ResultOk`, otherwise `None`.
29
- *
30
- * Usage Example:
31
- * const result = Ok(5);
32
- * const value = result.ok();
33
- * if (value.is_some()) {
34
- * console.log("Value:", value.unwrap());
35
- * }
36
- */
37
- ok(): Option<T>;
38
- /**
39
- * Retrieves the error from `ResultErr`, wrapped in an `Option`.
40
- * @returns `Some` containing the error if the result is `ResultErr`, otherwise `None`.
41
- *
42
- * Usage Example:
43
- * const result = Err(new Error("Error"));
44
- * const error = result.err();
45
- * if (error.is_some()) {
46
- * console.log("Error:", error.unwrap());
47
- * }
48
- */
49
- err(): Option<E>;
50
- /**
51
- * Returns the contained `ResultOk` value, but throws an error with a provided message if
52
- * the result is a `ResultErr`.
53
- * @param msg The message to throw with if the result is an error.
54
- * @returns The contained `ResultOk` value.
55
- *
56
- * Usage Example:
57
- * const result = Ok(5);
58
- * console.log(result.expect("This should not fail"));
59
- */
60
- expect(msg: string): T;
61
- /**
62
- * Unwraps a `ResultOk`, yielding the contained value.
63
- * @returns The `ResultOk` value.
64
- * @throws Throws if the result is `ResultErr`.
65
- *
66
- * Usage Example:
67
- * const result = Ok(5);
68
- * console.log(result.unwrap());
69
- */
70
- unwrap(): T;
71
- /**
72
- * Returns the contained `ResultErr` error, but throws an error with a provided message if
73
- * the result is a `ResultOk`.
74
- * @param msg The message to throw with if the result is Ok.
75
- * @returns The contained `ResultErr` error.
76
- *
77
- * Usage Example:
78
- * const result = Err(new Error("Failure"));
79
- * console.log(result.expect_err("Expected an error"));
80
- */
81
- expect_err(msg: string): E;
82
- /**
83
- * Unwraps a `ResultErr`, yielding the contained error.
84
- * @returns The `ResultErr` error.
85
- * @throws Throws if the result is `ResultOk`.
86
- *
87
- * Usage Example:
88
- * const result = Err(new Error("Failure"));
89
- * console.log(result.unwrap_err());
90
- */
91
- unwrap_err(): E;
92
- /**
93
- * Converts from `IResultCore<T, E>` to `T`.
94
- * @returns The contained `ResultOk` value.
95
- * @throws Throws if the result is `ResultErr`.
96
- *
97
- * Usage Example:
98
- * const result = Ok(5);
99
- * console.log(result.into_ok());
100
- */
101
- into_ok(): T;
102
- /**
103
- * Converts from `IResultCore<T, E>` to `E`.
104
- * @returns The contained `ResultErr` error.
105
- * @throws Throws if the result is `ResultOk`.
106
- *
107
- * Usage Example:
108
- * const result = Err(new Error("Failure"));
109
- * console.log(result.into_err());
110
- */
111
- into_err(): E;
112
- /**
113
- * Converts between different forms of `Result`, allowing the error type to be widened.
114
- *
115
- * If called on a `ResultOk<T, E>`, it will return a `Result<T, never>`, effectively discarding
116
- * the error type. This is useful when you want to use the `Result` in a context that expects
117
- * a `Result` with a specific error type, but you know that the `Result` is an `Ok` variant.
118
- *
119
- * If called on a `ResultErr<T, E>`, it will return a `Result<never, E>`, effectively discarding
120
- * the value type. This is useful when you want to use the `Result` in a context that expects
121
- * a `Result` with a specific value type, but you know that the `Result` is an `Err` variant.
122
- *
123
- * This is particularly useful when trying to forward a ResultErr returned by a function whose
124
- * error type overlaps with the returned error type of the current function, but whose value type
125
- * does not.
126
- *
127
- * Usage Example:
128
- * const result: Result<number, Error> = Ok<number, Error>(5);
129
- * const transmuted: Result<number, never> = result.transmute();
130
- *
131
- * const result: Result<number, Error> = Err<number, Error>(new Error("Failure"));
132
- * const transmuted: Result<never, Error> = result.transmute();
133
- */
134
- transmute(): Result<T, never> | Result<never, E>;
135
- }
136
- export interface IResultExt<T, E> extends IResultCore<T, E> {
137
- /**
138
- * Checks if the result is Ok and the contained value passes a specified condition.
139
- * @param f A predicate to apply to the contained value if the result is Ok.
140
- * @returns true if the result is Ok and the predicate returns true, otherwise false.
141
- *
142
- * Usage Examples:
143
- * const result = Ok(5);
144
- * if (result.is_ok_and(x => x > 3)) {
145
- * console.log("Result is Ok and greater than 3");
146
- * }
147
- *
148
- * const result = Ok(2);
149
- * if (!result.is_ok_and(x => x > 3)) {
150
- * console.log("Result is not Ok or not greater than 3");
151
- * }
152
- */
153
- is_ok_and(f: (value: T) => boolean): boolean;
154
- /**
155
- * Checks if the result is Err and the contained error passes a specified condition.
156
- * @param f A predicate to apply to the contained error if the result is Err.
157
- * @returns true if the result is Err and the predicate returns true, otherwise false.
158
- *
159
- * Usage Examples:
160
- * const result = Err(new Error("Network failure"));
161
- * if (result.is_err_and(e => e.message.includes("Network"))) {
162
- * console.log("Network error occurred");
163
- * }
164
- */
165
- is_err_and(f: (value: E) => boolean): boolean;
166
- /**
167
- * Transforms the result via a mapping function if it is Ok.
168
- * @param fn A function to transform the Ok value.
169
- * @returns A new Result where the Ok value has been transformed.
170
- *
171
- * Usage Example:
172
- * const result = Ok(5);
173
- * const mapped = result.map(x => x * 2);
174
- *
175
- * const result = Err("Error");
176
- * const mapped = result.map(x => x * 2); // remains Err
177
- */
178
- map<U>(fn: (arg: T) => U): Result<U, E>;
179
- /**
180
- * Transforms the result via a mapping function if it is Ok, otherwise returns a default value.
181
- * @param defaultVal A default value to return if the result is Err.
182
- * @param f A function to transform the Ok value.
183
- * @returns The transformed Ok value or the default value.
184
- *
185
- * Usage Example:
186
- * const result = Ok(5);
187
- * const value = result.map_or(0, x => x * 2);
188
- *
189
- * const result = Err("Error");
190
- * const value = result.map_or(0, x => x * 2); // 0
191
- */
192
- map_or<U>(defaultVal: U, f: (arg: T) => U): U;
193
- /**
194
- * Transforms the result via a mapping function if it is Ok, otherwise computes a default value using a function.
195
- * @param defaultFunc A function to compute a default value if the result is Err.
196
- * @param f A function to transform the Ok value.
197
- * @returns The transformed Ok value or the computed default value.
198
- *
199
- * Usage Example:
200
- * const result = Ok(5);
201
- * const value = result.map_or_else(() => 0, x => x * 2);
202
- *
203
- * const result = Err("Error");
204
- * const value = result.map_or_else(() => 0, x => x * 2); // 0
205
- */
206
- map_or_else<U>(defaultFunc: (err: E) => U, f: (arg: T) => U): U;
207
- /**
208
- * Maps a `Result<T, E>` to `Result<T, U>` by applying a function to a contained `Err` value, leaving an `Ok` value untouched.
209
- * @param fn A function to transform the Err value.
210
- * @returns A new Result where the Err has been transformed.
211
- *
212
- * Usage Example:
213
- * const result = Err("Error");
214
- * const mappedErr = result.map_err(e => new Error(e));
215
- */
216
- map_err<U>(fn: (arg: E) => U): Result<T, U>;
217
- /**
218
- * Applies a function to the contained value (if Ok), then returns the unmodified Result.
219
- * @param f A function to apply to the Ok value.
220
- * @returns The original Result.
221
- *
222
- * Usage Example:
223
- * const result = Ok(5);
224
- * result.inspect(x => console.log(`Value: ${x}`));
225
- */
226
- inspect(f: (val: T) => void): Result<T, E>;
227
- /**
228
- * Applies a function to the contained error (if Err), then returns the unmodified Result.
229
- * @param f A function to apply to the Err value.
230
- * @returns The original Result.
231
- *
232
- * Usage Example:
233
- * const result = Err("Error");
234
- * result.inspect_err(e => console.log(`Error: ${e}`));
235
- */
236
- inspect_err(f: (val: E) => void): Result<T, E>;
237
- /**
238
- * Returns `res` if the result is Ok, otherwise returns the Err value of `self`.
239
- * @param res The result to return if `self` is Ok.
240
- * @returns Either `res` or the original Err.
241
- *
242
- * Usage Example:
243
- * const result = Ok(5);
244
- * const other = Ok("Hello");
245
- * const finalResult = result.and(other); // Ok("Hello")
246
- */
247
- and<U>(res: Result<U, E>): Result<U, E>;
248
- /**
249
- * Calls `fn` if the result is Ok, otherwise returns the Err value of `self`.
250
- * @param fn A function to apply to the Ok value.
251
- * @returns The result of `fn` if the original result is Ok, otherwise the Err.
252
- *
253
- * Usage Example:
254
- * const result = Ok(5);
255
- * const finalResult = result.and_then(x => Ok(x * 2)); // Ok(10)
256
- */
257
- and_then<U>(fn: (arg: T) => Result<U, E>): Result<U, E>;
258
- /**
259
- * Returns `res` if the result is Err, otherwise returns the Ok value of `self`.
260
- * @param res The result to return if `self` is Err.
261
- * @returns Either `res` or the original Ok.
262
- *
263
- * Usage Example:
264
- * const result = Err("Error");
265
- * const other = Ok(5);
266
- * const finalResult = result.or(other); // Ok(5)
267
- */
268
- or<U>(res: Result<U, E>): Result<U, E>;
269
- /**
270
- * Calls `fn` if the result is Err, otherwise returns the Ok value of `self`.
271
- * @param fn A function to apply to the Err value.
272
- * @returns The result of `fn` if the original result is Err, otherwise the Ok.
273
- *
274
- * Usage Example:
275
- * const result = Err("Error");
276
- * const finalResult = result.or_else(e => Ok(`Handled ${e}`)); // Ok("Handled Error")
277
- */
278
- or_else<U>(fn: (arg: E) => Result<T, U>): Result<T, U>;
279
- /**
280
- * Returns the contained Ok value or a provided default.
281
- * @param defaultVal The default value to return if the result is Err.
282
- * @returns The Ok value or the default.
283
- *
284
- * Usage Example:
285
- * const result = Ok(5);
286
- * console.log(result.unwrap_or(0)); // 5
287
- *
288
- * const result = Err("Error");
289
- * console.log(result.unwrap_or(0)); // 0
290
- */
291
- unwrap_or(defaultVal: T): T;
292
- /**
293
- * Returns the contained Ok value or computes it from a function.
294
- * @param fn A function to compute the default value if the result is Err.
295
- * @returns The Ok value or the computed one.
296
- *
297
- * Usage Example:
298
- * const result = Err("Error");
299
- * console.log(result.unwrap_or_else(() => 5)); // 5
300
- */
301
- unwrap_or_else(fn: (arg: E) => T): T;
302
- }
303
- type UnwrapResult<T> = T extends Result<infer U, any> ? U : T;
304
- export interface IResultIteration<T, E> extends IResultCore<T, E> {
305
- /**
306
- * Returns an iterator over the potentially contained value.
307
- * @returns An iterator which yields the contained value if it is `ResultOk<T, E>`.
308
- *
309
- * Usage Example:
310
- * const okResult = Ok(5);
311
- * for (const value of okResult.iter()) {
312
- * console.log(value); // prints 5
313
- * }
314
- *
315
- * const errResult = Err(new Error("error"));
316
- * for (const value of errResult.iter()) {
317
- * // This block will not be executed.
318
- * }
319
- */
320
- iter(): IterableIterator<T>;
321
- /**
322
- * Flattens a nested `Result` if the contained value is itself a `Result`.
323
- * @returns A single-layer `Result`, by stripping one layer of `Result` container.
324
- *
325
- * Usage Example:
326
- * const nestedOk = Ok(Ok(5));
327
- * const flattened = nestedOk.flatten(); // Results in Ok(5)
328
- *
329
- * const nestedErr = Ok(Err(new Error("error")));
330
- * const flattenedError = nestedErr.flatten(); // Results in Err(new Error("error"))
331
- */
332
- flatten(): Result<UnwrapResult<T>, E>;
333
- }
334
- export interface IResult<T, E> extends IResultCore<T, E>, IResultExt<T, E>, IResultIteration<T, E> {
335
- }
336
- export declare const isResultOk: <T, E>(val: any) => val is ResultOk<T, E>;
337
- export declare const isResultErr: <T, E>(val: any) => val is ResultErr<T, E>;
338
- export declare class ResultOk<T, E> implements IResult<T, E> {
339
- readonly value: T;
340
- private readonly _tag;
341
- private readonly _T;
342
- private readonly _E;
343
- constructor(value: T);
344
- is_ok(): this is ResultOk<T, E>;
345
- is_err(): this is never;
346
- is_ok_and(f: (value: T) => boolean): boolean;
347
- is_err_and(_f: (value: E) => boolean): boolean;
348
- ok(): Option<T>;
349
- err(): Option<E>;
350
- map<U>(fn: (arg: T) => U): Result<U, E>;
351
- map_or<U>(_d: U, f: (arg: T) => U): U;
352
- map_or_else<U>(_d: (e: E) => U, f: (arg: T) => U): U;
353
- map_err<U>(_fn: (arg: E) => U): Result<T, U>;
354
- inspect(f: (val: T) => void): Result<T, E>;
355
- inspect_err(_f: (val: E) => void): Result<T, E>;
356
- iter(): IterableIterator<T>;
357
- expect(_msg: string): T;
358
- unwrap(): T;
359
- expect_err(msg: string): E;
360
- unwrap_err(): never;
361
- and<U>(res: Result<U, E>): Result<U, E>;
362
- and_then<U>(fn: (arg: T) => Result<U, E>): Result<U, E>;
363
- or<U>(_res: Result<U, E>): Result<U, E>;
364
- or_else<U>(fn: (arg: E) => Result<T, U>): Result<T, U>;
365
- unwrap_or(_optb: T): T;
366
- unwrap_or_else(_fn: (arg: E) => T): T;
367
- flatten(): Result<UnwrapResult<T>, E>;
368
- into_ok(): T;
369
- into_err(): never;
370
- transmute(): Result<T, never>;
371
- }
372
- export declare class ResultErr<T, E> implements IResult<T, E> {
373
- readonly value: E;
374
- private readonly _tag;
375
- private readonly _T;
376
- private readonly _E;
377
- constructor(value: E);
378
- is_ok(): this is never;
379
- is_err(): this is ResultErr<T, E>;
380
- is_ok_and(_f: (value: T) => boolean): boolean;
381
- is_err_and(f: (value: E) => boolean): boolean;
382
- ok(): Option<T>;
383
- err(): Option<E>;
384
- map<U>(_fn: (arg: T) => U): Result<U, E>;
385
- map_or<U>(d: U, _f: (arg: T) => U): U;
386
- map_or_else<U>(d: (e: E) => U, _f: (arg: T) => U): U;
387
- map_err<U>(fn: (arg: E) => U): Result<T, U>;
388
- inspect(_f: (val: T) => void): Result<T, E>;
389
- inspect_err(f: (val: E) => void): Result<T, E>;
390
- iter(): IterableIterator<T>;
391
- expect(msg: string): never;
392
- unwrap(): never;
393
- expect_err(_msg: string): E;
394
- unwrap_err(): E;
395
- and<U>(_res: Result<U, E>): Result<U, E>;
396
- and_then<U>(_fn: (arg: T) => Result<U, E>): Result<U, E>;
397
- or<U>(res: Result<U, E>): Result<U, E>;
398
- or_else<U>(fn: (arg: E) => Result<T, U>): Result<T, U>;
399
- unwrap_or(optb: T): T;
400
- unwrap_or_else(fn: (arg: E) => T): T;
401
- flatten(): Result<UnwrapResult<T>, E>;
402
- into_ok(): T;
403
- into_err(): E;
404
- transmute(): Result<never, E>;
405
- }
406
- export declare const Ok: <T, E>(val: T) => Result<T, never>;
407
- export declare const Err: <T, E>(val: E) => Result<never, E>;
408
- export declare const try_catch: <T, E = Error>(fn: () => T) => Result<T, E>;
409
- export declare const result_from_promise: <T, E = Error>(val: Promise<T>) => Promise<Result<T, E>>;
410
- export {};
package/dist/result.js DELETED
@@ -1,231 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.result_from_promise = exports.try_catch = exports.Err = exports.Ok = exports.ResultErr = exports.ResultOk = exports.isResultErr = exports.isResultOk = void 0;
4
- const option_1 = require("./option");
5
- const isResultOk = (val) => {
6
- return val instanceof ResultOk;
7
- };
8
- exports.isResultOk = isResultOk;
9
- const isResultErr = (val) => {
10
- return val instanceof ResultErr;
11
- };
12
- exports.isResultErr = isResultErr;
13
- class ResultOk {
14
- constructor(value) {
15
- this.value = value;
16
- this._tag = 'Ok';
17
- }
18
- is_ok() {
19
- return true;
20
- }
21
- is_err() {
22
- return false;
23
- }
24
- is_ok_and(f) {
25
- return f(this.value);
26
- }
27
- is_err_and(_f) {
28
- return false;
29
- }
30
- ok() {
31
- return (0, option_1.Some)(this.value);
32
- }
33
- err() {
34
- return (0, option_1.None)();
35
- }
36
- map(fn) {
37
- return new ResultOk(fn(this.value));
38
- }
39
- map_or(_d, f) {
40
- return f(this.value);
41
- }
42
- map_or_else(_d, f) {
43
- return f(this.value);
44
- }
45
- map_err(_fn) {
46
- return this;
47
- }
48
- inspect(f) {
49
- f(this.value);
50
- return this;
51
- }
52
- inspect_err(_f) {
53
- return this;
54
- }
55
- iter() {
56
- return [this.value][Symbol.iterator]();
57
- }
58
- expect(_msg) {
59
- return this.value;
60
- }
61
- unwrap() {
62
- return this.value;
63
- }
64
- //unwrap_or_default(): T {
65
- // ! not implemented
66
- //}
67
- expect_err(msg) {
68
- throw new Error(msg);
69
- }
70
- unwrap_err() {
71
- throw new Error('Called Result.unwrap_err() on an Ok value: ' + this.value);
72
- }
73
- and(res) {
74
- return res;
75
- }
76
- and_then(fn) {
77
- return fn(this.value);
78
- }
79
- or(_res) {
80
- return this;
81
- }
82
- or_else(fn) {
83
- return this;
84
- }
85
- unwrap_or(_optb) {
86
- return this.value;
87
- }
88
- unwrap_or_else(_fn) {
89
- return this.value;
90
- }
91
- flatten() {
92
- if (this.value instanceof ResultOk || this.value instanceof ResultErr) {
93
- return this.value;
94
- }
95
- else {
96
- // This case should not happen if T is always a Result,
97
- // but it's here to satisfy TypeScript's type checker.
98
- return new ResultOk(this.value);
99
- }
100
- }
101
- into_ok() {
102
- return this.value;
103
- }
104
- into_err() {
105
- throw new Error('Called Result.into_err() on an Ok value: ' + this.value);
106
- }
107
- transmute() {
108
- return this;
109
- }
110
- }
111
- exports.ResultOk = ResultOk;
112
- class ResultErr {
113
- constructor(value) {
114
- this.value = value;
115
- this._tag = 'Err';
116
- }
117
- is_ok() {
118
- return false;
119
- }
120
- is_err() {
121
- return true;
122
- }
123
- is_ok_and(_f) {
124
- return false;
125
- }
126
- is_err_and(f) {
127
- return f(this.value);
128
- }
129
- ok() {
130
- return (0, option_1.None)();
131
- }
132
- err() {
133
- return (0, option_1.Some)(this.value);
134
- }
135
- map(_fn) {
136
- return this;
137
- }
138
- map_or(d, _f) {
139
- return d;
140
- }
141
- map_or_else(d, _f) {
142
- return d(this.value);
143
- }
144
- map_err(fn) {
145
- return new ResultErr(fn(this.value));
146
- }
147
- inspect(_f) {
148
- return this;
149
- }
150
- inspect_err(f) {
151
- f(this.value);
152
- return this;
153
- }
154
- iter() {
155
- return [][Symbol.iterator]();
156
- }
157
- expect(msg) {
158
- throw new Error(msg);
159
- }
160
- unwrap() {
161
- throw new Error('Called Result.unwrap() on an Err value: ' + this.value);
162
- }
163
- //unwrap_or_default(): never {
164
- // // ! not implemented
165
- //}
166
- expect_err(_msg) {
167
- return this.value;
168
- }
169
- unwrap_err() {
170
- return this.value;
171
- }
172
- and(_res) {
173
- return this;
174
- }
175
- and_then(_fn) {
176
- return this;
177
- }
178
- or(res) {
179
- return res;
180
- }
181
- or_else(fn) {
182
- return fn(this.value);
183
- }
184
- unwrap_or(optb) {
185
- return optb;
186
- }
187
- unwrap_or_else(fn) {
188
- return fn(this.value);
189
- }
190
- flatten() {
191
- return new ResultErr(this.value);
192
- }
193
- into_ok() {
194
- throw new Error('Called Result.into_ok() on an Err value: ' + this.value);
195
- }
196
- into_err() {
197
- return this.value;
198
- }
199
- transmute() {
200
- return this;
201
- }
202
- }
203
- exports.ResultErr = ResultErr;
204
- const Ok = (val) => {
205
- return new ResultOk(val);
206
- };
207
- exports.Ok = Ok;
208
- const Err = (val) => {
209
- return new ResultErr(val);
210
- };
211
- exports.Err = Err;
212
- const try_catch = (fn) => {
213
- try {
214
- return (0, exports.Ok)(fn());
215
- // @ts-ignore (error is nominally of type any / unknown, not Error)
216
- }
217
- catch (error) {
218
- return (0, exports.Err)(error);
219
- }
220
- };
221
- exports.try_catch = try_catch;
222
- const result_from_promise = async (val) => {
223
- try {
224
- return new ResultOk(await val);
225
- }
226
- catch (error) {
227
- return new ResultErr(error);
228
- }
229
- };
230
- exports.result_from_promise = result_from_promise;
231
- //# sourceMappingURL=result.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":";;;AAAA,qCAA8C;AAiXvC,MAAM,UAAU,GAAG,CAAO,GAAQ,EAAyB,EAAE;IAChE,OAAO,GAAG,YAAY,QAAQ,CAAC;AACnC,CAAC,CAAA;AAFY,QAAA,UAAU,cAEtB;AAEM,MAAM,WAAW,GAAG,CAAO,GAAQ,EAA0B,EAAE;IAClE,OAAO,GAAG,YAAY,SAAS,CAAC;AACpC,CAAC,CAAA;AAFY,QAAA,WAAW,eAEvB;AAED,MAAa,QAAQ;IAOjB,YAAqB,KAAQ;QAAR,UAAK,GAAL,KAAK,CAAG;QANZ,SAAI,GAAG,IAAa,CA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