happy-rusty 1.1.0 → 1.1.1
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/README.cn.md +1 -1
- package/README.md +1 -1
- package/dist/main.cjs.map +1 -1
- package/dist/main.mjs.map +1 -1
- package/dist/types.d.ts +0 -2
- package/docs/{index.md → README.md} +4 -4
- package/docs/functions/Err.md +8 -8
- package/docs/functions/Ok.md +8 -8
- package/docs/functions/Some.md +8 -8
- package/docs/functions/promiseToResult.md +8 -8
- package/docs/interfaces/None.md +127 -127
- package/docs/interfaces/Option.md +113 -119
- package/docs/interfaces/Result.md +104 -110
- package/docs/type-aliases/AsyncIOResult.md +8 -8
- package/docs/type-aliases/AsyncOption.md +8 -8
- package/docs/type-aliases/AsyncResult.md +8 -8
- package/docs/type-aliases/IOResult.md +8 -8
- package/docs/variables/None.md +4 -4
- package/package.json +8 -8
- package/src/enum/prelude.ts +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[**happy-rusty**](../
|
|
1
|
+
[**happy-rusty**](../README.md) • **Docs**
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[happy-rusty](../
|
|
5
|
+
[happy-rusty](../README.md) / AsyncResult
|
|
6
6
|
|
|
7
|
-
# Type
|
|
7
|
+
# Type Alias: AsyncResult\<T, E\>
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
10
|
type AsyncResult<T, E>: Promise<Result<T, E>>;
|
|
@@ -13,13 +13,13 @@ type AsyncResult<T, E>: Promise<Result<T, E>>;
|
|
|
13
13
|
Represents an asynchronous operation that yields a `Result<T, E>`.
|
|
14
14
|
This is a promise that resolves to `Ok(T)` if the operation was successful, or `Err(E)` if there was an error.
|
|
15
15
|
|
|
16
|
-
## Type
|
|
16
|
+
## Type Parameters
|
|
17
17
|
|
|
18
|
-
| Type
|
|
19
|
-
|
|
|
18
|
+
| Type Parameter | Description |
|
|
19
|
+
| ------ | ------ |
|
|
20
20
|
| `T` | The type of the value that is produced by a successful operation. |
|
|
21
21
|
| `E` | The type of the error that may be produced by a failed operation. |
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Defined in
|
|
24
24
|
|
|
25
|
-
[
|
|
25
|
+
[prelude.ts:591](https://github.com/JiangJie/happy-rusty/blob/82bfb94138be23b97750c830432d7e013c0e5b80/src/enum/prelude.ts#L591)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[**happy-rusty**](../
|
|
1
|
+
[**happy-rusty**](../README.md) • **Docs**
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[happy-rusty](../
|
|
5
|
+
[happy-rusty](../README.md) / IOResult
|
|
6
6
|
|
|
7
|
-
# Type
|
|
7
|
+
# Type Alias: IOResult\<T\>
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
10
|
type IOResult<T>: Result<T, Error>;
|
|
@@ -13,12 +13,12 @@ type IOResult<T>: Result<T, Error>;
|
|
|
13
13
|
Represents a synchronous operation that yields a `Result<T, Error>`.
|
|
14
14
|
This is a result that is either `Ok(T)` if the operation was successful, or `Err(Error)` if there was an error.
|
|
15
15
|
|
|
16
|
-
## Type
|
|
16
|
+
## Type Parameters
|
|
17
17
|
|
|
18
|
-
| Type
|
|
19
|
-
|
|
|
18
|
+
| Type Parameter | Description |
|
|
19
|
+
| ------ | ------ |
|
|
20
20
|
| `T` | The type of the value that is produced by a successful operation. |
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Defined in
|
|
23
23
|
|
|
24
|
-
[
|
|
24
|
+
[prelude.ts:599](https://github.com/JiangJie/happy-rusty/blob/82bfb94138be23b97750c830432d7e013c0e5b80/src/enum/prelude.ts#L599)
|
package/docs/variables/None.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[**happy-rusty**](../
|
|
1
|
+
[**happy-rusty**](../README.md) • **Docs**
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[happy-rusty](../
|
|
5
|
+
[happy-rusty](../README.md) / None
|
|
6
6
|
|
|
7
7
|
# Variable: None
|
|
8
8
|
|
|
@@ -13,6 +13,6 @@ None: None;
|
|
|
13
13
|
A constant representing the `None` case of an `Option`, indicating the absence of a value.
|
|
14
14
|
This constant is frozen to ensure it is immutable and cannot be altered, preserving the integrity of `None` throughout the application.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Defined in
|
|
17
17
|
|
|
18
|
-
[
|
|
18
|
+
[prelude.ts:286](https://github.com/JiangJie/happy-rusty/blob/82bfb94138be23b97750c830432d7e013c0e5b80/src/enum/prelude.ts#L286)
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Porting some excellent design implementations from Rust to JavaScript.",
|
|
4
4
|
"author": "jiang115jie@gmail.com",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"source": "src/mod.ts",
|
|
9
9
|
"main": "dist/main.cjs",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"Err"
|
|
48
48
|
],
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
51
|
-
"@typescript-eslint/parser": "^7.
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
51
|
+
"@typescript-eslint/parser": "^7.16.0",
|
|
52
52
|
"eslint": "^8.57.0",
|
|
53
|
-
"rollup": "^4.18.
|
|
53
|
+
"rollup": "^4.18.1",
|
|
54
54
|
"rollup-plugin-dts": "^6.1.1",
|
|
55
55
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
56
|
-
"typedoc": "^0.
|
|
57
|
-
"typedoc-plugin-markdown": "^4.
|
|
58
|
-
"typescript": "^5.
|
|
56
|
+
"typedoc": "^0.26.4",
|
|
57
|
+
"typedoc-plugin-markdown": "^4.2.1",
|
|
58
|
+
"typescript": "^5.5.3"
|
|
59
59
|
},
|
|
60
|
-
"packageManager": "pnpm@9.
|
|
60
|
+
"packageManager": "pnpm@9.5.0"
|
|
61
61
|
}
|
package/src/enum/prelude.ts
CHANGED
|
@@ -282,8 +282,6 @@ export interface Option<T> {
|
|
|
282
282
|
/**
|
|
283
283
|
* Represents the absence of a value, as a specialized `Option` type.
|
|
284
284
|
* The type parameter is set to `never` because `None` does not hold a value.
|
|
285
|
-
*
|
|
286
|
-
* @extends {Option<never>} Extends the generic `Option` type with `never` to denote no value.
|
|
287
285
|
*/
|
|
288
286
|
export interface None extends Option<never> {
|
|
289
287
|
/**
|