exupery-core-internals 0.1.9 → 0.1.11
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
CHANGED
package/dist/index.js
CHANGED
|
@@ -24,3 +24,4 @@ __exportStar(require("./imp/public/switch_state"), exports);
|
|
|
24
24
|
__exportStar(require("./imp/public/get_location_info"), exports);
|
|
25
25
|
__exportStar(require("./imp/public/set"), exports);
|
|
26
26
|
__exportStar(require("./imp/public/not_set"), exports);
|
|
27
|
+
__exportStar(require("./unguaranteed_transaction_result"), exports);
|
|
@@ -3,8 +3,9 @@ export interface Unguaranteed_Transformation_Result<T, E> {
|
|
|
3
3
|
* @param set what to do when the value was set, returns the new type
|
|
4
4
|
* @param not_set what to do when the value was not set, returns the new type
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
process(success: ($: T) => void, exception: ($: E) => void): void;
|
|
7
7
|
map<NT, NE>(handle_value: ($: T) => NT, handle_exception: ($: E) => NE): Unguaranteed_Transformation_Result<NT, NE>;
|
|
8
|
+
map_result<NT>(handle_value: ($: T) => NT): Unguaranteed_Transformation_Result<NT, E>;
|
|
8
9
|
transform<NT>(handle_value: ($: T) => NT, handle_exception: ($: E) => NT): NT;
|
|
9
10
|
}
|
|
10
11
|
export declare namespace transformation {
|
|
@@ -5,7 +5,7 @@ var transformation;
|
|
|
5
5
|
(function (transformation) {
|
|
6
6
|
transformation.failed = (exception) => {
|
|
7
7
|
return {
|
|
8
|
-
|
|
8
|
+
process: (success, exception_handler) => {
|
|
9
9
|
exception_handler(exception);
|
|
10
10
|
},
|
|
11
11
|
'transform': (success, exception_handler) => {
|
|
@@ -13,12 +13,15 @@ var transformation;
|
|
|
13
13
|
},
|
|
14
14
|
'map': (handle_value, handle_exception) => {
|
|
15
15
|
return transformation.failed(handle_exception(exception));
|
|
16
|
+
},
|
|
17
|
+
'map_result': (handle_value) => {
|
|
18
|
+
return transformation.failed(exception);
|
|
16
19
|
}
|
|
17
20
|
};
|
|
18
21
|
};
|
|
19
22
|
transformation.successful = (value) => {
|
|
20
23
|
return {
|
|
21
|
-
|
|
24
|
+
process: (success, exception_handler) => {
|
|
22
25
|
success(value);
|
|
23
26
|
},
|
|
24
27
|
'transform': (success, exception_handler) => {
|
|
@@ -26,6 +29,9 @@ var transformation;
|
|
|
26
29
|
},
|
|
27
30
|
'map': (handle_value, handle_exception) => {
|
|
28
31
|
return transformation.successful(handle_value(value));
|
|
32
|
+
},
|
|
33
|
+
'map_result': (handle_value) => {
|
|
34
|
+
return transformation.successful(handle_value(value));
|
|
29
35
|
}
|
|
30
36
|
};
|
|
31
37
|
};
|