retuple 1.0.0-next.19 → 1.0.0-next.20

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/index.cjs CHANGED
@@ -285,400 +285,12 @@ function $safeRetry(f, mapError = ensureError) {
285
285
  }
286
286
  });
287
287
  }
288
- /**
289
- * ## RetupleArray
290
- *
291
- * Using built-in array methods on a `Result` is probably a mistake. This class
292
- * makes the built-in methods throw `RetupleArrayMethodUnavailableError`.
293
- */
294
- class RetupleArray extends Array {
295
- /**
296
- * ## Method not available
297
- *
298
- * Built-in array methods not available on {@link Result} types.
299
- *
300
- * @deprecated
301
- */
302
- at() {
303
- throw new RetupleArrayMethodUnavailableError(this, "at");
304
- }
305
- /**
306
- * ## Method not available
307
- *
308
- * Built-in array methods not available on {@link Result} types.
309
- *
310
- * @deprecated
311
- */
312
- concat() {
313
- throw new RetupleArrayMethodUnavailableError(this, "concat");
314
- }
315
- /**
316
- * ## Method not available
317
- *
318
- * Built-in array methods not available on {@link Result} types.
319
- *
320
- * @deprecated
321
- */
322
- copyWithin() {
323
- throw new RetupleArrayMethodUnavailableError(this, "copyWithin");
324
- }
325
- /**
326
- * ## Method not available
327
- *
328
- * Built-in array methods not available on {@link Result} types.
329
- *
330
- * @deprecated
331
- */
332
- entries() {
333
- throw new RetupleArrayMethodUnavailableError(this, "entries");
334
- }
335
- /**
336
- * ## Method not available
337
- *
338
- * Built-in array methods not available on {@link Result} types.
339
- *
340
- * @deprecated
341
- */
342
- every() {
343
- throw new RetupleArrayMethodUnavailableError(this, "every");
344
- }
345
- /**
346
- * ## Method not available
347
- *
348
- * Built-in array methods not available on {@link Result} types.
349
- *
350
- * @deprecated
351
- */
352
- fill() {
353
- throw new RetupleArrayMethodUnavailableError(this, "fill");
354
- }
355
- /**
356
- * ## Method not available
357
- *
358
- * Built-in array methods not available on {@link Result} types.
359
- *
360
- * @deprecated
361
- */
362
- filter() {
363
- throw new RetupleArrayMethodUnavailableError(this, "filter");
364
- }
365
- /**
366
- * ## Method not available
367
- *
368
- * Built-in array methods not available on {@link Result} types.
369
- *
370
- * @deprecated
371
- */
372
- find() {
373
- throw new RetupleArrayMethodUnavailableError(this, "find");
374
- }
375
- /**
376
- * ## Method not available
377
- *
378
- * Built-in array methods not available on {@link Result} types.
379
- *
380
- * @deprecated
381
- */
382
- findIndex() {
383
- throw new RetupleArrayMethodUnavailableError(this, "findIndex");
384
- }
385
- /**
386
- * ## Method not available
387
- *
388
- * Built-in array methods not available on {@link Result} types.
389
- *
390
- * @deprecated
391
- */
392
- findLast() {
393
- throw new RetupleArrayMethodUnavailableError(this, "findLast");
394
- }
395
- /**
396
- * ## Method not available
397
- *
398
- * Built-in array methods not available on {@link Result} types.
399
- *
400
- * @deprecated
401
- */
402
- findLastIndex() {
403
- throw new RetupleArrayMethodUnavailableError(this, "findLastIndex");
404
- }
405
- /**
406
- * ## Method not available
407
- *
408
- * Built-in array methods not available on {@link Result} types.
409
- *
410
- * @deprecated
411
- */
412
- flat() {
413
- throw new RetupleArrayMethodUnavailableError(this, "flat");
414
- }
415
- /**
416
- * ## Method not available
417
- *
418
- * Built-in array methods not available on {@link Result} types.
419
- *
420
- * @deprecated
421
- */
422
- flatMap() {
423
- throw new RetupleArrayMethodUnavailableError(this, "flatMap");
424
- }
425
- /**
426
- * ## Method not available
427
- *
428
- * Built-in array methods not available on {@link Result} types.
429
- *
430
- * @deprecated
431
- */
432
- forEach() {
433
- throw new RetupleArrayMethodUnavailableError(this, "forEach");
434
- }
435
- /**
436
- * ## Method not available
437
- *
438
- * Built-in array methods not available on {@link Result} types.
439
- *
440
- * @deprecated
441
- */
442
- includes() {
443
- throw new RetupleArrayMethodUnavailableError(this, "includes");
444
- }
445
- /**
446
- * ## Method not available
447
- *
448
- * Built-in array methods not available on {@link Result} types.
449
- *
450
- * @deprecated
451
- */
452
- indexOf() {
453
- throw new RetupleArrayMethodUnavailableError(this, "indexOf");
454
- }
455
- /**
456
- * ## Method not available
457
- *
458
- * Built-in array methods not available on {@link Result} types.
459
- *
460
- * @deprecated
461
- */
462
- join() {
463
- throw new RetupleArrayMethodUnavailableError(this, "join");
464
- }
465
- /**
466
- * ## Method not available
467
- *
468
- * Built-in array methods not available on {@link Result} types.
469
- *
470
- * @deprecated
471
- */
472
- keys() {
473
- throw new RetupleArrayMethodUnavailableError(this, "keys");
474
- }
475
- /**
476
- * ## Method not available
477
- *
478
- * Built-in array methods not available on {@link Result} types.
479
- *
480
- * @deprecated
481
- */
482
- lastIndexOf() {
483
- throw new RetupleArrayMethodUnavailableError(this, "lastIndexOf");
484
- }
485
- /**
486
- * ## Method not available
487
- *
488
- * Built-in array methods not available on {@link Result} types.
489
- *
490
- * @deprecated
491
- */
492
- map() {
493
- throw new RetupleArrayMethodUnavailableError(this, "map");
494
- }
495
- /**
496
- * ## Method not available
497
- *
498
- * Built-in array methods not available on {@link Result} types.
499
- *
500
- * @deprecated
501
- */
502
- pop() {
503
- throw new RetupleArrayMethodUnavailableError(this, "pop");
504
- }
505
- /**
506
- * ## Method not available
507
- *
508
- * Built-in array methods not available on {@link Result} types.
509
- *
510
- * @deprecated
511
- */
512
- push() {
513
- throw new RetupleArrayMethodUnavailableError(this, "push");
514
- }
515
- /**
516
- * ## Method not available
517
- *
518
- * Built-in array methods not available on {@link Result} types.
519
- *
520
- * @deprecated
521
- */
522
- reduce() {
523
- throw new RetupleArrayMethodUnavailableError(this, "reduce");
524
- }
525
- /**
526
- * ## Method not available
527
- *
528
- * Built-in array methods not available on {@link Result} types.
529
- *
530
- * @deprecated
531
- */
532
- reduceRight() {
533
- throw new RetupleArrayMethodUnavailableError(this, "reduceRight");
534
- }
535
- /**
536
- * ## Method not available
537
- *
538
- * Built-in array methods not available on {@link Result} types.
539
- *
540
- * @deprecated
541
- */
542
- reverse() {
543
- throw new RetupleArrayMethodUnavailableError(this, "reverse");
544
- }
545
- /**
546
- * ## Method not available
547
- *
548
- * Built-in array methods not available on {@link Result} types.
549
- *
550
- * @deprecated
551
- */
552
- shift() {
553
- throw new RetupleArrayMethodUnavailableError(this, "shift");
554
- }
555
- /**
556
- * ## Method not available
557
- *
558
- * Built-in array methods not available on {@link Result} types.
559
- *
560
- * @deprecated
561
- */
562
- slice() {
563
- throw new RetupleArrayMethodUnavailableError(this, "slice");
564
- }
565
- /**
566
- * ## Method not available
567
- *
568
- * Built-in array methods not available on {@link Result} types.
569
- *
570
- * @deprecated
571
- */
572
- some() {
573
- throw new RetupleArrayMethodUnavailableError(this, "some");
574
- }
575
- /**
576
- * ## Method not available
577
- *
578
- * Built-in array methods not available on {@link Result} types.
579
- *
580
- * @deprecated
581
- */
582
- sort() {
583
- throw new RetupleArrayMethodUnavailableError(this, "sort");
584
- }
585
- /**
586
- * ## Method not available
587
- *
588
- * Built-in array methods not available on {@link Result} types.
589
- *
590
- * @deprecated
591
- */
592
- splice() {
593
- throw new RetupleArrayMethodUnavailableError(this, "splice");
594
- }
595
- /**
596
- * ## Method not available
597
- *
598
- * Built-in array methods not available on {@link Result} types.
599
- *
600
- * @deprecated
601
- */
602
- toString() {
603
- throw new RetupleArrayMethodUnavailableError(this, "toString");
604
- }
605
- /**
606
- * ## Method not available
607
- *
608
- * Built-in array methods not available on {@link Result} types.
609
- *
610
- * @deprecated
611
- */
612
- toLocaleString() {
613
- throw new RetupleArrayMethodUnavailableError(this, "toLocaleString");
614
- }
615
- /**
616
- * ## Method not available
617
- *
618
- * Built-in array methods not available on {@link Result} types.
619
- *
620
- * @deprecated
621
- */
622
- toReversed() {
623
- throw new RetupleArrayMethodUnavailableError(this, "toReversed");
624
- }
625
- /**
626
- * ## Method not available
627
- *
628
- * Built-in array methods not available on {@link Result} types.
629
- *
630
- * @deprecated
631
- */
632
- toSorted() {
633
- throw new RetupleArrayMethodUnavailableError(this, "toSorted");
634
- }
635
- /**
636
- * ## Method not available
637
- *
638
- * Built-in array methods not available on {@link Result} types.
639
- *
640
- * @deprecated
641
- */
642
- toSpliced() {
643
- throw new RetupleArrayMethodUnavailableError(this, "toSpliced");
644
- }
645
- /**
646
- * ## Method not available
647
- *
648
- * Built-in array methods not available on {@link Result} types.
649
- *
650
- * @deprecated
651
- */
652
- unshift() {
653
- throw new RetupleArrayMethodUnavailableError(this, "unshift");
654
- }
655
- /**
656
- * ## Method not available
657
- *
658
- * Built-in array methods not available on {@link Result} types.
659
- *
660
- * @deprecated
661
- */
662
- values() {
663
- throw new RetupleArrayMethodUnavailableError(this, "values");
664
- }
665
- /**
666
- * ## Method not available
667
- *
668
- * Built-in array methods not available on {@link Result} types.
669
- *
670
- * @deprecated
671
- */
672
- with() {
673
- throw new RetupleArrayMethodUnavailableError(this, "with");
674
- }
675
- }
676
288
  /**
677
289
  * ## ResultOk
678
290
  *
679
291
  * This is the `Ok` variant of a `Result`, used internally and not exported.
680
292
  */
681
- class ResultOk extends RetupleArray {
293
+ class ResultOk extends Array {
682
294
  constructor(value) {
683
295
  super(2);
684
296
  this[0] = undefined;
@@ -818,7 +430,7 @@ class ResultOk extends RetupleArray {
818
430
  *
819
431
  * This is the `Err` variant of a `Result`, used internally and not exported.
820
432
  */
821
- class ResultErr extends RetupleArray {
433
+ class ResultErr extends Array {
822
434
  constructor(err) {
823
435
  super(2);
824
436
  this[0] = err;
package/dist/index.d.cts CHANGED
@@ -148,318 +148,6 @@ export declare function Ok<const T>(val: T): Result<T, never>;
148
148
  */
149
149
  export declare function Err(): Result<never, void>;
150
150
  export declare function Err<const E>(err: E): Result<never, E>;
151
- /**
152
- * ## RetupleArray
153
- *
154
- * Using built-in array methods on a `Result` is probably a mistake. This class
155
- * makes the built-in methods throw `RetupleArrayMethodUnavailableError`.
156
- */
157
- declare class RetupleArray<T> extends Array<T> {
158
- /**
159
- * ## Method not available
160
- *
161
- * Built-in array methods not available on {@link Result} types.
162
- *
163
- * @deprecated
164
- */
165
- at(): never;
166
- /**
167
- * ## Method not available
168
- *
169
- * Built-in array methods not available on {@link Result} types.
170
- *
171
- * @deprecated
172
- */
173
- concat(): never;
174
- /**
175
- * ## Method not available
176
- *
177
- * Built-in array methods not available on {@link Result} types.
178
- *
179
- * @deprecated
180
- */
181
- copyWithin(): never;
182
- /**
183
- * ## Method not available
184
- *
185
- * Built-in array methods not available on {@link Result} types.
186
- *
187
- * @deprecated
188
- */
189
- entries(): never;
190
- /**
191
- * ## Method not available
192
- *
193
- * Built-in array methods not available on {@link Result} types.
194
- *
195
- * @deprecated
196
- */
197
- every(): this is never[];
198
- /**
199
- * ## Method not available
200
- *
201
- * Built-in array methods not available on {@link Result} types.
202
- *
203
- * @deprecated
204
- */
205
- fill(): never;
206
- /**
207
- * ## Method not available
208
- *
209
- * Built-in array methods not available on {@link Result} types.
210
- *
211
- * @deprecated
212
- */
213
- filter(): never;
214
- /**
215
- * ## Method not available
216
- *
217
- * Built-in array methods not available on {@link Result} types.
218
- *
219
- * @deprecated
220
- */
221
- find(): never;
222
- /**
223
- * ## Method not available
224
- *
225
- * Built-in array methods not available on {@link Result} types.
226
- *
227
- * @deprecated
228
- */
229
- findIndex(): never;
230
- /**
231
- * ## Method not available
232
- *
233
- * Built-in array methods not available on {@link Result} types.
234
- *
235
- * @deprecated
236
- */
237
- findLast(): never;
238
- /**
239
- * ## Method not available
240
- *
241
- * Built-in array methods not available on {@link Result} types.
242
- *
243
- * @deprecated
244
- */
245
- findLastIndex(): never;
246
- /**
247
- * ## Method not available
248
- *
249
- * Built-in array methods not available on {@link Result} types.
250
- *
251
- * @deprecated
252
- */
253
- flat(): never;
254
- /**
255
- * ## Method not available
256
- *
257
- * Built-in array methods not available on {@link Result} types.
258
- *
259
- * @deprecated
260
- */
261
- flatMap(): never;
262
- /**
263
- * ## Method not available
264
- *
265
- * Built-in array methods not available on {@link Result} types.
266
- *
267
- * @deprecated
268
- */
269
- forEach(): never;
270
- /**
271
- * ## Method not available
272
- *
273
- * Built-in array methods not available on {@link Result} types.
274
- *
275
- * @deprecated
276
- */
277
- includes(): never;
278
- /**
279
- * ## Method not available
280
- *
281
- * Built-in array methods not available on {@link Result} types.
282
- *
283
- * @deprecated
284
- */
285
- indexOf(): never;
286
- /**
287
- * ## Method not available
288
- *
289
- * Built-in array methods not available on {@link Result} types.
290
- *
291
- * @deprecated
292
- */
293
- join(): never;
294
- /**
295
- * ## Method not available
296
- *
297
- * Built-in array methods not available on {@link Result} types.
298
- *
299
- * @deprecated
300
- */
301
- keys(): never;
302
- /**
303
- * ## Method not available
304
- *
305
- * Built-in array methods not available on {@link Result} types.
306
- *
307
- * @deprecated
308
- */
309
- lastIndexOf(): never;
310
- /**
311
- * ## Method not available
312
- *
313
- * Built-in array methods not available on {@link Result} types.
314
- *
315
- * @deprecated
316
- */
317
- map(): never;
318
- /**
319
- * ## Method not available
320
- *
321
- * Built-in array methods not available on {@link Result} types.
322
- *
323
- * @deprecated
324
- */
325
- pop(): never;
326
- /**
327
- * ## Method not available
328
- *
329
- * Built-in array methods not available on {@link Result} types.
330
- *
331
- * @deprecated
332
- */
333
- push(): never;
334
- /**
335
- * ## Method not available
336
- *
337
- * Built-in array methods not available on {@link Result} types.
338
- *
339
- * @deprecated
340
- */
341
- reduce(): never;
342
- /**
343
- * ## Method not available
344
- *
345
- * Built-in array methods not available on {@link Result} types.
346
- *
347
- * @deprecated
348
- */
349
- reduceRight(): never;
350
- /**
351
- * ## Method not available
352
- *
353
- * Built-in array methods not available on {@link Result} types.
354
- *
355
- * @deprecated
356
- */
357
- reverse(): never;
358
- /**
359
- * ## Method not available
360
- *
361
- * Built-in array methods not available on {@link Result} types.
362
- *
363
- * @deprecated
364
- */
365
- shift(): never;
366
- /**
367
- * ## Method not available
368
- *
369
- * Built-in array methods not available on {@link Result} types.
370
- *
371
- * @deprecated
372
- */
373
- slice(): never;
374
- /**
375
- * ## Method not available
376
- *
377
- * Built-in array methods not available on {@link Result} types.
378
- *
379
- * @deprecated
380
- */
381
- some(): never;
382
- /**
383
- * ## Method not available
384
- *
385
- * Built-in array methods not available on {@link Result} types.
386
- *
387
- * @deprecated
388
- */
389
- sort(): never;
390
- /**
391
- * ## Method not available
392
- *
393
- * Built-in array methods not available on {@link Result} types.
394
- *
395
- * @deprecated
396
- */
397
- splice(): never;
398
- /**
399
- * ## Method not available
400
- *
401
- * Built-in array methods not available on {@link Result} types.
402
- *
403
- * @deprecated
404
- */
405
- toString(): never;
406
- /**
407
- * ## Method not available
408
- *
409
- * Built-in array methods not available on {@link Result} types.
410
- *
411
- * @deprecated
412
- */
413
- toLocaleString(): never;
414
- /**
415
- * ## Method not available
416
- *
417
- * Built-in array methods not available on {@link Result} types.
418
- *
419
- * @deprecated
420
- */
421
- toReversed(): never;
422
- /**
423
- * ## Method not available
424
- *
425
- * Built-in array methods not available on {@link Result} types.
426
- *
427
- * @deprecated
428
- */
429
- toSorted(): never;
430
- /**
431
- * ## Method not available
432
- *
433
- * Built-in array methods not available on {@link Result} types.
434
- *
435
- * @deprecated
436
- */
437
- toSpliced(): never;
438
- /**
439
- * ## Method not available
440
- *
441
- * Built-in array methods not available on {@link Result} types.
442
- *
443
- * @deprecated
444
- */
445
- unshift(): never;
446
- /**
447
- * ## Method not available
448
- *
449
- * Built-in array methods not available on {@link Result} types.
450
- *
451
- * @deprecated
452
- */
453
- values(): never;
454
- /**
455
- * ## Method not available
456
- *
457
- * Built-in array methods not available on {@link Result} types.
458
- *
459
- * @deprecated
460
- */
461
- with(): never;
462
- }
463
151
  /**
464
152
  * ## ResultAsync
465
153
  *
@@ -733,7 +421,7 @@ declare class ResultRetry<T, E> extends ResultAsync<T, E> implements PromiseLike
733
421
  $handle(f: (controller: ResultRetryController<E>) => void): ResultRetry<T, E>;
734
422
  private drain;
735
423
  }
736
- interface Retuple<T, E> extends RetupleArray<T | E | undefined>, ResultLike<T, E> {
424
+ interface Retuple<T, E> extends ResultLike<T, E> {
737
425
  /**
738
426
  * Returns true when this result is `Ok`. Acts as a type guard.
739
427
  *