@aeriajs/types 0.0.60 → 0.0.61
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.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/result.d.ts +10 -0
- package/dist/result.js +14 -0
- package/dist/result.mjs +13 -0
- package/package.json +1 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __exportStar(require("./endpointError.js"), exports);
|
|
|
25
25
|
__exportStar(require("./functions.js"), exports);
|
|
26
26
|
__exportStar(require("./http.js"), exports);
|
|
27
27
|
__exportStar(require("./property.js"), exports);
|
|
28
|
+
__exportStar(require("./result.js"), exports);
|
|
28
29
|
__exportStar(require("./schema.js"), exports);
|
|
29
30
|
__exportStar(require("./security.js"), exports);
|
|
30
31
|
__exportStar(require("./token.js"), exports);
|
package/dist/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./endpointError.mjs";
|
|
|
10
10
|
export * from "./functions.mjs";
|
|
11
11
|
export * from "./http.mjs";
|
|
12
12
|
export * from "./property.mjs";
|
|
13
|
+
export * from "./result.mjs";
|
|
13
14
|
export * from "./schema.mjs";
|
|
14
15
|
export * from "./security.mjs";
|
|
15
16
|
export * from "./token.mjs";
|
package/dist/result.d.ts
CHANGED
|
@@ -10,6 +10,16 @@ export declare namespace Result {
|
|
|
10
10
|
readonly result: T;
|
|
11
11
|
};
|
|
12
12
|
type Either<E, R> = Result.Error<E> | Result.Result<R>;
|
|
13
|
+
const error: <const TValue>(value: TValue) => {
|
|
14
|
+
readonly _tag: "Error";
|
|
15
|
+
readonly error: TValue;
|
|
16
|
+
readonly result: undefined;
|
|
17
|
+
};
|
|
18
|
+
const result: <const TValue>(value: TValue) => {
|
|
19
|
+
readonly _tag: "Result";
|
|
20
|
+
readonly error: undefined;
|
|
21
|
+
readonly result: TValue;
|
|
22
|
+
};
|
|
13
23
|
}
|
|
14
24
|
export type ExtractError<T> = T extends Result.Error<infer L> ? L : never;
|
|
15
25
|
export type ExtractResult<T> = T extends Result.Result<infer R> ? R : never;
|
package/dist/result.js
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Result = void 0;
|
|
4
|
+
var Result;
|
|
5
|
+
(function (Result) {
|
|
6
|
+
Result.error = (value) => ({
|
|
7
|
+
_tag: 'Error',
|
|
8
|
+
error: value,
|
|
9
|
+
result: undefined,
|
|
10
|
+
});
|
|
11
|
+
Result.result = (value) => ({
|
|
12
|
+
_tag: 'Result',
|
|
13
|
+
error: undefined,
|
|
14
|
+
result: value,
|
|
15
|
+
});
|
|
16
|
+
})(Result || (exports.Result = Result = {}));
|
package/dist/result.mjs
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
export var Result;
|
|
3
|
+
((Result2) => {
|
|
4
|
+
Result2.error = (value) => ({
|
|
5
|
+
_tag: "Error",
|
|
6
|
+
error: value,
|
|
7
|
+
result: void 0
|
|
8
|
+
});
|
|
9
|
+
Result2.result = (value) => ({
|
|
10
|
+
_tag: "Result",
|
|
11
|
+
error: void 0,
|
|
12
|
+
result: value
|
|
13
|
+
});
|
|
14
|
+
})(Result || (Result = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
"import": "./dist/index.mjs",
|
|
14
14
|
"require": "./dist/index.js",
|
|
15
15
|
"types": "./dist/index.d.ts"
|
|
16
|
-
},
|
|
17
|
-
"./result": {
|
|
18
|
-
"import": "./dist/result.mjs",
|
|
19
|
-
"require": "./dist/result.js",
|
|
20
|
-
"types": "./dist/result.d.ts"
|
|
21
16
|
}
|
|
22
17
|
},
|
|
23
18
|
"keywords": [],
|