exupery-core-internals 0.3.1 → 0.3.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.
@@ -1,5 +1,5 @@
1
1
  import * as _et from 'exupery-core-types';
2
2
  export declare namespace refinement {
3
- const failed: <T, E>(exception: E) => _et.Refinement_Result<T, E>;
3
+ const failed: <T, E>(error: E) => _et.Refinement_Result<T, E>;
4
4
  const successful: <T, E>(value: T) => _et.Refinement_Result<T, E>;
5
5
  }
@@ -3,42 +3,48 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.refinement = void 0;
4
4
  var refinement;
5
5
  (function (refinement) {
6
- refinement.failed = (exception) => {
6
+ refinement.failed = (error) => {
7
7
  return {
8
- 'process': (success, exception_handler) => {
9
- exception_handler(exception);
8
+ 'process': (success, error_handler) => {
9
+ error_handler(error);
10
10
  },
11
- 'transform': (success, exception_handler) => {
12
- return exception_handler(exception);
11
+ 'transform': (success, error_handler) => {
12
+ return error_handler(error);
13
13
  },
14
14
  'with_result': (success) => {
15
- return refinement.failed(exception);
15
+ return refinement.failed(error);
16
16
  },
17
- 'map': (handle_value, handle_exception) => {
18
- return refinement.failed(handle_exception(exception));
17
+ 'map': (handle_value, handle_error) => {
18
+ return refinement.failed(handle_error(error));
19
19
  },
20
20
  'map_result': (handle_value) => {
21
- return refinement.failed(exception);
22
- }
21
+ return refinement.failed(error);
22
+ },
23
+ 'transform_error': (handle_error) => {
24
+ return refinement.failed(handle_error(error));
25
+ },
23
26
  };
24
27
  };
25
28
  refinement.successful = (value) => {
26
29
  return {
27
- 'process': (success, exception_handler) => {
30
+ 'process': (success, error_handler) => {
28
31
  success(value);
29
32
  },
30
- 'transform': (success, exception_handler) => {
33
+ 'transform': (success, error_handler) => {
31
34
  return success(value);
32
35
  },
33
36
  'with_result': (success) => {
34
37
  return success(value);
35
38
  },
36
- 'map': (handle_value, handle_exception) => {
39
+ 'map': (handle_value, handle_error) => {
37
40
  return refinement.successful(handle_value(value));
38
41
  },
39
42
  'map_result': (handle_value) => {
40
43
  return refinement.successful(handle_value(value));
41
- }
44
+ },
45
+ 'transform_error': (handle_error) => {
46
+ return refinement.successful(value);
47
+ },
42
48
  };
43
49
  };
44
50
  })(refinement || (exports.refinement = refinement = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exupery-core-internals",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "license": "ISC",
5
5
  "description": "",
6
6
  "author": "Corno",
@@ -15,7 +15,7 @@
15
15
  "url": "https://github.com/corno/exupery-core/issues"
16
16
  },
17
17
  "dependencies": {
18
- "exupery-core-types": "^0.3.2"
18
+ "exupery-core-types": "^0.3.30"
19
19
  },
20
20
  "main": "./dist/index.js",
21
21
  "types": "dist/index.d.ts",