happy-rusty 1.1.1 → 1.1.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.
- package/dist/main.cjs +12 -0
- package/dist/main.cjs.map +1 -1
- package/dist/main.mjs +12 -0
- package/dist/main.mjs.map +1 -1
- package/dist/types.d.ts +19 -0
- package/docs/functions/Err.md +1 -1
- package/docs/functions/Ok.md +1 -1
- package/docs/functions/Some.md +1 -1
- package/docs/functions/promiseToResult.md +1 -1
- package/docs/interfaces/None.md +26 -26
- package/docs/interfaces/Option.md +25 -25
- package/docs/interfaces/Result.md +82 -25
- package/docs/type-aliases/AsyncIOResult.md +1 -1
- package/docs/type-aliases/AsyncOption.md +1 -1
- package/docs/type-aliases/AsyncResult.md +1 -1
- package/docs/type-aliases/IOResult.md +1 -1
- package/docs/variables/None.md +1 -1
- package/package.json +3 -3
- package/src/enum/prelude.ts +35 -0
package/docs/interfaces/None.md
CHANGED
|
@@ -17,7 +17,7 @@ The type parameter is set to `never` because `None` does not hold a value.
|
|
|
17
17
|
|
|
18
18
|
| Property | Modifier | Type | Description | Overrides | Defined in |
|
|
19
19
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
20
|
-
| `[optionKindSymbol]` | `readonly` | `"None"` | When using `None` alone, the following overrides can make type inference more accurate. | `Option.[optionKindSymbol]` | [prelude.ts:291](https://github.com/JiangJie/happy-rusty/blob/
|
|
20
|
+
| `[optionKindSymbol]` | `readonly` | `"None"` | When using `None` alone, the following overrides can make type inference more accurate. | `Option.[optionKindSymbol]` | [prelude.ts:291](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L291) |
|
|
21
21
|
|
|
22
22
|
## Methods
|
|
23
23
|
|
|
@@ -54,7 +54,7 @@ This is sometimes called "and then" because it is similar to a logical AND opera
|
|
|
54
54
|
|
|
55
55
|
#### Defined in
|
|
56
56
|
|
|
57
|
-
[prelude.ts:306](https://github.com/JiangJie/happy-rusty/blob/
|
|
57
|
+
[prelude.ts:306](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L306)
|
|
58
58
|
|
|
59
59
|
***
|
|
60
60
|
|
|
@@ -91,7 +91,7 @@ The result of `fn` if `this` is `Some`, otherwise `None`.
|
|
|
91
91
|
|
|
92
92
|
#### Defined in
|
|
93
93
|
|
|
94
|
-
[prelude.ts:307](https://github.com/JiangJie/happy-rusty/blob/
|
|
94
|
+
[prelude.ts:307](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L307)
|
|
95
95
|
|
|
96
96
|
***
|
|
97
97
|
|
|
@@ -128,7 +128,7 @@ This method can be used for comparing `Option` instances in a value-sensitive ma
|
|
|
128
128
|
|
|
129
129
|
#### Defined in
|
|
130
130
|
|
|
131
|
-
[prelude.ts:312](https://github.com/JiangJie/happy-rusty/blob/
|
|
131
|
+
[prelude.ts:312](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L312)
|
|
132
132
|
|
|
133
133
|
***
|
|
134
134
|
|
|
@@ -160,7 +160,7 @@ Throws an error with the provided message if the Option is a `None`.
|
|
|
160
160
|
|
|
161
161
|
#### Defined in
|
|
162
162
|
|
|
163
|
-
[prelude.ts:80](https://github.com/JiangJie/happy-rusty/blob/
|
|
163
|
+
[prelude.ts:80](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L80)
|
|
164
164
|
|
|
165
165
|
***
|
|
166
166
|
|
|
@@ -190,7 +190,7 @@ Returns `None` if the Option is `None`, otherwise calls predicate with the wrapp
|
|
|
190
190
|
|
|
191
191
|
#### Defined in
|
|
192
192
|
|
|
193
|
-
[prelude.ts:298](https://github.com/JiangJie/happy-rusty/blob/
|
|
193
|
+
[prelude.ts:298](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L298)
|
|
194
194
|
|
|
195
195
|
***
|
|
196
196
|
|
|
@@ -214,7 +214,7 @@ Converts from `Option<Option<T>>` to `Option<T>`.
|
|
|
214
214
|
|
|
215
215
|
#### Defined in
|
|
216
216
|
|
|
217
|
-
[prelude.ts:299](https://github.com/JiangJie/happy-rusty/blob/
|
|
217
|
+
[prelude.ts:299](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L299)
|
|
218
218
|
|
|
219
219
|
***
|
|
220
220
|
|
|
@@ -245,7 +245,7 @@ This is primarily for side effects and does not transform the `Option`.
|
|
|
245
245
|
|
|
246
246
|
#### Defined in
|
|
247
247
|
|
|
248
|
-
[prelude.ts:267](https://github.com/JiangJie/happy-rusty/blob/
|
|
248
|
+
[prelude.ts:267](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L267)
|
|
249
249
|
|
|
250
250
|
***
|
|
251
251
|
|
|
@@ -267,7 +267,7 @@ Returns `true` if the Option is a `None` value.
|
|
|
267
267
|
|
|
268
268
|
#### Defined in
|
|
269
269
|
|
|
270
|
-
[prelude.ts:59](https://github.com/JiangJie/happy-rusty/blob/
|
|
270
|
+
[prelude.ts:59](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L59)
|
|
271
271
|
|
|
272
272
|
***
|
|
273
273
|
|
|
@@ -289,7 +289,7 @@ Returns `true` if the Option is a `Some` value.
|
|
|
289
289
|
|
|
290
290
|
#### Defined in
|
|
291
291
|
|
|
292
|
-
[prelude.ts:54](https://github.com/JiangJie/happy-rusty/blob/
|
|
292
|
+
[prelude.ts:54](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L54)
|
|
293
293
|
|
|
294
294
|
***
|
|
295
295
|
|
|
@@ -317,7 +317,7 @@ Returns `true` if the Option is a `Some` value and the predicate returns `true`
|
|
|
317
317
|
|
|
318
318
|
#### Defined in
|
|
319
319
|
|
|
320
|
-
[prelude.ts:65](https://github.com/JiangJie/happy-rusty/blob/
|
|
320
|
+
[prelude.ts:65](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L65)
|
|
321
321
|
|
|
322
322
|
***
|
|
323
323
|
|
|
@@ -351,7 +351,7 @@ Maps an `Option<T>` to `Option<U>` by applying a function to a contained value.
|
|
|
351
351
|
|
|
352
352
|
#### Defined in
|
|
353
353
|
|
|
354
|
-
[prelude.ts:300](https://github.com/JiangJie/happy-rusty/blob/
|
|
354
|
+
[prelude.ts:300](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L300)
|
|
355
355
|
|
|
356
356
|
***
|
|
357
357
|
|
|
@@ -386,7 +386,7 @@ Maps an `Option<T>` to `U` by applying a function to the contained value (if any
|
|
|
386
386
|
|
|
387
387
|
#### Defined in
|
|
388
388
|
|
|
389
|
-
[prelude.ts:163](https://github.com/JiangJie/happy-rusty/blob/
|
|
389
|
+
[prelude.ts:163](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L163)
|
|
390
390
|
|
|
391
391
|
***
|
|
392
392
|
|
|
@@ -421,7 +421,7 @@ Maps an `Option<T>` to `U` by applying a function to a contained value (if any),
|
|
|
421
421
|
|
|
422
422
|
#### Defined in
|
|
423
423
|
|
|
424
|
-
[prelude.ts:171](https://github.com/JiangJie/happy-rusty/blob/
|
|
424
|
+
[prelude.ts:171](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L171)
|
|
425
425
|
|
|
426
426
|
***
|
|
427
427
|
|
|
@@ -455,7 +455,7 @@ Transforms the `Option<T>` into a `Result<T, E>`, mapping `Some(v)` to `Ok(v)` a
|
|
|
455
455
|
|
|
456
456
|
#### Defined in
|
|
457
457
|
|
|
458
|
-
[prelude.ts:113](https://github.com/JiangJie/happy-rusty/blob/
|
|
458
|
+
[prelude.ts:113](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L113)
|
|
459
459
|
|
|
460
460
|
***
|
|
461
461
|
|
|
@@ -489,7 +489,7 @@ Transforms the `Option<T>` into a `Result<T, E>`, mapping `Some(v)` to `Ok(v)` a
|
|
|
489
489
|
|
|
490
490
|
#### Defined in
|
|
491
491
|
|
|
492
|
-
[prelude.ts:120](https://github.com/JiangJie/happy-rusty/blob/
|
|
492
|
+
[prelude.ts:120](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L120)
|
|
493
493
|
|
|
494
494
|
***
|
|
495
495
|
|
|
@@ -526,7 +526,7 @@ This can be used for providing a fallback `Option`.
|
|
|
526
526
|
|
|
527
527
|
#### Defined in
|
|
528
528
|
|
|
529
|
-
[prelude.ts:308](https://github.com/JiangJie/happy-rusty/blob/
|
|
529
|
+
[prelude.ts:308](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L308)
|
|
530
530
|
|
|
531
531
|
***
|
|
532
532
|
|
|
@@ -563,7 +563,7 @@ This method can be used for lazy fallbacks, as `fn` is only evaluated if `this`
|
|
|
563
563
|
|
|
564
564
|
#### Defined in
|
|
565
565
|
|
|
566
|
-
[prelude.ts:309](https://github.com/JiangJie/happy-rusty/blob/
|
|
566
|
+
[prelude.ts:309](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L309)
|
|
567
567
|
|
|
568
568
|
***
|
|
569
569
|
|
|
@@ -589,7 +589,7 @@ Transposes an `Option` of a `Result` into a `Result` of an `Option`.
|
|
|
589
589
|
|
|
590
590
|
#### Defined in
|
|
591
591
|
|
|
592
|
-
[prelude.ts:296](https://github.com/JiangJie/happy-rusty/blob/
|
|
592
|
+
[prelude.ts:296](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L296)
|
|
593
593
|
|
|
594
594
|
***
|
|
595
595
|
|
|
@@ -615,7 +615,7 @@ Throws an error if the value is a `None`.
|
|
|
615
615
|
|
|
616
616
|
#### Defined in
|
|
617
617
|
|
|
618
|
-
[prelude.ts:86](https://github.com/JiangJie/happy-rusty/blob/
|
|
618
|
+
[prelude.ts:86](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L86)
|
|
619
619
|
|
|
620
620
|
***
|
|
621
621
|
|
|
@@ -649,7 +649,7 @@ Returns the contained `Some` value or a provided default.
|
|
|
649
649
|
|
|
650
650
|
#### Defined in
|
|
651
651
|
|
|
652
|
-
[prelude.ts:293](https://github.com/JiangJie/happy-rusty/blob/
|
|
652
|
+
[prelude.ts:293](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L293)
|
|
653
653
|
|
|
654
654
|
***
|
|
655
655
|
|
|
@@ -683,7 +683,7 @@ Returns the contained `Some` value or computes it from a closure.
|
|
|
683
683
|
|
|
684
684
|
#### Defined in
|
|
685
685
|
|
|
686
|
-
[prelude.ts:294](https://github.com/JiangJie/happy-rusty/blob/
|
|
686
|
+
[prelude.ts:294](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L294)
|
|
687
687
|
|
|
688
688
|
***
|
|
689
689
|
|
|
@@ -709,7 +709,7 @@ A tuple of `Options`, one for each element in the original `Option` of a tuple.
|
|
|
709
709
|
|
|
710
710
|
#### Defined in
|
|
711
711
|
|
|
712
|
-
[prelude.ts:304](https://github.com/JiangJie/happy-rusty/blob/
|
|
712
|
+
[prelude.ts:304](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L304)
|
|
713
713
|
|
|
714
714
|
***
|
|
715
715
|
|
|
@@ -746,7 +746,7 @@ This can be thought of as an exclusive or operation on `Option` values.
|
|
|
746
746
|
|
|
747
747
|
#### Defined in
|
|
748
748
|
|
|
749
|
-
[prelude.ts:310](https://github.com/JiangJie/happy-rusty/blob/
|
|
749
|
+
[prelude.ts:310](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L310)
|
|
750
750
|
|
|
751
751
|
***
|
|
752
752
|
|
|
@@ -784,7 +784,7 @@ An `Option` containing a tuple of the values if both are `Some`, otherwise `None
|
|
|
784
784
|
|
|
785
785
|
#### Defined in
|
|
786
786
|
|
|
787
|
-
[prelude.ts:302](https://github.com/JiangJie/happy-rusty/blob/
|
|
787
|
+
[prelude.ts:302](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L302)
|
|
788
788
|
|
|
789
789
|
***
|
|
790
790
|
|
|
@@ -824,4 +824,4 @@ An `Option` containing the result of `fn` if both `Options` are `Some`, otherwis
|
|
|
824
824
|
|
|
825
825
|
#### Defined in
|
|
826
826
|
|
|
827
|
-
[prelude.ts:303](https://github.com/JiangJie/happy-rusty/blob/
|
|
827
|
+
[prelude.ts:303](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L303)
|
|
@@ -58,7 +58,7 @@ This is sometimes called "and then" because it is similar to a logical AND opera
|
|
|
58
58
|
|
|
59
59
|
#### Defined in
|
|
60
60
|
|
|
61
|
-
[prelude.ts:224](https://github.com/JiangJie/happy-rusty/blob/
|
|
61
|
+
[prelude.ts:224](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L224)
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
@@ -91,7 +91,7 @@ The result of `fn` if `this` is `Some`, otherwise `None`.
|
|
|
91
91
|
|
|
92
92
|
#### Defined in
|
|
93
93
|
|
|
94
|
-
[prelude.ts:233](https://github.com/JiangJie/happy-rusty/blob/
|
|
94
|
+
[prelude.ts:233](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L233)
|
|
95
95
|
|
|
96
96
|
***
|
|
97
97
|
|
|
@@ -118,7 +118,7 @@ This method can be used for comparing `Option` instances in a value-sensitive ma
|
|
|
118
118
|
|
|
119
119
|
#### Defined in
|
|
120
120
|
|
|
121
|
-
[prelude.ts:277](https://github.com/JiangJie/happy-rusty/blob/
|
|
121
|
+
[prelude.ts:277](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L277)
|
|
122
122
|
|
|
123
123
|
***
|
|
124
124
|
|
|
@@ -146,7 +146,7 @@ Throws an error with the provided message if the Option is a `None`.
|
|
|
146
146
|
|
|
147
147
|
#### Defined in
|
|
148
148
|
|
|
149
|
-
[prelude.ts:80](https://github.com/JiangJie/happy-rusty/blob/
|
|
149
|
+
[prelude.ts:80](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L80)
|
|
150
150
|
|
|
151
151
|
***
|
|
152
152
|
|
|
@@ -172,7 +172,7 @@ Returns `None` if the Option is `None`, otherwise calls predicate with the wrapp
|
|
|
172
172
|
|
|
173
173
|
#### Defined in
|
|
174
174
|
|
|
175
|
-
[prelude.ts:142](https://github.com/JiangJie/happy-rusty/blob/
|
|
175
|
+
[prelude.ts:142](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L142)
|
|
176
176
|
|
|
177
177
|
***
|
|
178
178
|
|
|
@@ -204,7 +204,7 @@ Converts from `Option<Option<T>>` to `Option<T>`.
|
|
|
204
204
|
|
|
205
205
|
#### Defined in
|
|
206
206
|
|
|
207
|
-
[prelude.ts:148](https://github.com/JiangJie/happy-rusty/blob/
|
|
207
|
+
[prelude.ts:148](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L148)
|
|
208
208
|
|
|
209
209
|
***
|
|
210
210
|
|
|
@@ -231,7 +231,7 @@ This is primarily for side effects and does not transform the `Option`.
|
|
|
231
231
|
|
|
232
232
|
#### Defined in
|
|
233
233
|
|
|
234
|
-
[prelude.ts:267](https://github.com/JiangJie/happy-rusty/blob/
|
|
234
|
+
[prelude.ts:267](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L267)
|
|
235
235
|
|
|
236
236
|
***
|
|
237
237
|
|
|
@@ -249,7 +249,7 @@ Returns `true` if the Option is a `None` value.
|
|
|
249
249
|
|
|
250
250
|
#### Defined in
|
|
251
251
|
|
|
252
|
-
[prelude.ts:59](https://github.com/JiangJie/happy-rusty/blob/
|
|
252
|
+
[prelude.ts:59](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L59)
|
|
253
253
|
|
|
254
254
|
***
|
|
255
255
|
|
|
@@ -267,7 +267,7 @@ Returns `true` if the Option is a `Some` value.
|
|
|
267
267
|
|
|
268
268
|
#### Defined in
|
|
269
269
|
|
|
270
|
-
[prelude.ts:54](https://github.com/JiangJie/happy-rusty/blob/
|
|
270
|
+
[prelude.ts:54](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L54)
|
|
271
271
|
|
|
272
272
|
***
|
|
273
273
|
|
|
@@ -291,7 +291,7 @@ Returns `true` if the Option is a `Some` value and the predicate returns `true`
|
|
|
291
291
|
|
|
292
292
|
#### Defined in
|
|
293
293
|
|
|
294
|
-
[prelude.ts:65](https://github.com/JiangJie/happy-rusty/blob/
|
|
294
|
+
[prelude.ts:65](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L65)
|
|
295
295
|
|
|
296
296
|
***
|
|
297
297
|
|
|
@@ -321,7 +321,7 @@ Maps an `Option<T>` to `Option<U>` by applying a function to a contained value.
|
|
|
321
321
|
|
|
322
322
|
#### Defined in
|
|
323
323
|
|
|
324
|
-
[prelude.ts:155](https://github.com/JiangJie/happy-rusty/blob/
|
|
324
|
+
[prelude.ts:155](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L155)
|
|
325
325
|
|
|
326
326
|
***
|
|
327
327
|
|
|
@@ -352,7 +352,7 @@ Maps an `Option<T>` to `U` by applying a function to the contained value (if any
|
|
|
352
352
|
|
|
353
353
|
#### Defined in
|
|
354
354
|
|
|
355
|
-
[prelude.ts:163](https://github.com/JiangJie/happy-rusty/blob/
|
|
355
|
+
[prelude.ts:163](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L163)
|
|
356
356
|
|
|
357
357
|
***
|
|
358
358
|
|
|
@@ -383,7 +383,7 @@ Maps an `Option<T>` to `U` by applying a function to a contained value (if any),
|
|
|
383
383
|
|
|
384
384
|
#### Defined in
|
|
385
385
|
|
|
386
|
-
[prelude.ts:171](https://github.com/JiangJie/happy-rusty/blob/
|
|
386
|
+
[prelude.ts:171](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L171)
|
|
387
387
|
|
|
388
388
|
***
|
|
389
389
|
|
|
@@ -413,7 +413,7 @@ Transforms the `Option<T>` into a `Result<T, E>`, mapping `Some(v)` to `Ok(v)` a
|
|
|
413
413
|
|
|
414
414
|
#### Defined in
|
|
415
415
|
|
|
416
|
-
[prelude.ts:113](https://github.com/JiangJie/happy-rusty/blob/
|
|
416
|
+
[prelude.ts:113](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L113)
|
|
417
417
|
|
|
418
418
|
***
|
|
419
419
|
|
|
@@ -443,7 +443,7 @@ Transforms the `Option<T>` into a `Result<T, E>`, mapping `Some(v)` to `Ok(v)` a
|
|
|
443
443
|
|
|
444
444
|
#### Defined in
|
|
445
445
|
|
|
446
|
-
[prelude.ts:120](https://github.com/JiangJie/happy-rusty/blob/
|
|
446
|
+
[prelude.ts:120](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L120)
|
|
447
447
|
|
|
448
448
|
***
|
|
449
449
|
|
|
@@ -470,7 +470,7 @@ This can be used for providing a fallback `Option`.
|
|
|
470
470
|
|
|
471
471
|
#### Defined in
|
|
472
472
|
|
|
473
|
-
[prelude.ts:241](https://github.com/JiangJie/happy-rusty/blob/
|
|
473
|
+
[prelude.ts:241](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L241)
|
|
474
474
|
|
|
475
475
|
***
|
|
476
476
|
|
|
@@ -497,7 +497,7 @@ This method can be used for lazy fallbacks, as `fn` is only evaluated if `this`
|
|
|
497
497
|
|
|
498
498
|
#### Defined in
|
|
499
499
|
|
|
500
|
-
[prelude.ts:249](https://github.com/JiangJie/happy-rusty/blob/
|
|
500
|
+
[prelude.ts:249](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L249)
|
|
501
501
|
|
|
502
502
|
***
|
|
503
503
|
|
|
@@ -532,7 +532,7 @@ Transposes an `Option` of a `Result` into a `Result` of an `Option`.
|
|
|
532
532
|
|
|
533
533
|
#### Defined in
|
|
534
534
|
|
|
535
|
-
[prelude.ts:130](https://github.com/JiangJie/happy-rusty/blob/
|
|
535
|
+
[prelude.ts:130](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L130)
|
|
536
536
|
|
|
537
537
|
***
|
|
538
538
|
|
|
@@ -554,7 +554,7 @@ Throws an error if the value is a `None`.
|
|
|
554
554
|
|
|
555
555
|
#### Defined in
|
|
556
556
|
|
|
557
|
-
[prelude.ts:86](https://github.com/JiangJie/happy-rusty/blob/
|
|
557
|
+
[prelude.ts:86](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L86)
|
|
558
558
|
|
|
559
559
|
***
|
|
560
560
|
|
|
@@ -578,7 +578,7 @@ Returns the contained `Some` value or a provided default.
|
|
|
578
578
|
|
|
579
579
|
#### Defined in
|
|
580
580
|
|
|
581
|
-
[prelude.ts:92](https://github.com/JiangJie/happy-rusty/blob/
|
|
581
|
+
[prelude.ts:92](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L92)
|
|
582
582
|
|
|
583
583
|
***
|
|
584
584
|
|
|
@@ -602,7 +602,7 @@ Returns the contained `Some` value or computes it from a closure.
|
|
|
602
602
|
|
|
603
603
|
#### Defined in
|
|
604
604
|
|
|
605
|
-
[prelude.ts:98](https://github.com/JiangJie/happy-rusty/blob/
|
|
605
|
+
[prelude.ts:98](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L98)
|
|
606
606
|
|
|
607
607
|
***
|
|
608
608
|
|
|
@@ -637,7 +637,7 @@ A tuple of `Options`, one for each element in the original `Option` of a tuple.
|
|
|
637
637
|
|
|
638
638
|
#### Defined in
|
|
639
639
|
|
|
640
|
-
[prelude.ts:207](https://github.com/JiangJie/happy-rusty/blob/
|
|
640
|
+
[prelude.ts:207](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L207)
|
|
641
641
|
|
|
642
642
|
***
|
|
643
643
|
|
|
@@ -664,7 +664,7 @@ This can be thought of as an exclusive or operation on `Option` values.
|
|
|
664
664
|
|
|
665
665
|
#### Defined in
|
|
666
666
|
|
|
667
|
-
[prelude.ts:257](https://github.com/JiangJie/happy-rusty/blob/
|
|
667
|
+
[prelude.ts:257](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L257)
|
|
668
668
|
|
|
669
669
|
***
|
|
670
670
|
|
|
@@ -698,7 +698,7 @@ An `Option` containing a tuple of the values if both are `Some`, otherwise `None
|
|
|
698
698
|
|
|
699
699
|
#### Defined in
|
|
700
700
|
|
|
701
|
-
[prelude.ts:185](https://github.com/JiangJie/happy-rusty/blob/
|
|
701
|
+
[prelude.ts:185](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L185)
|
|
702
702
|
|
|
703
703
|
***
|
|
704
704
|
|
|
@@ -734,4 +734,4 @@ An `Option` containing the result of `fn` if both `Options` are `Some`, otherwis
|
|
|
734
734
|
|
|
735
735
|
#### Defined in
|
|
736
736
|
|
|
737
|
-
[prelude.ts:197](https://github.com/JiangJie/happy-rusty/blob/
|
|
737
|
+
[prelude.ts:197](https://github.com/JiangJie/happy-rusty/blob/7218a182717eb5dbba4bfaf783977bc5e378815a/src/enum/prelude.ts#L197)
|