@rotomeca/rop 3.0.0 → 3.0.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/dist/cjs/index.js +5 -5
- package/dist/cjs/src/classes/Fail.js +2 -2
- package/dist/cjs/src/classes/Success.js +2 -2
- package/dist/cjs/src/classes/abstracts/ATresult.js +17 -0
- package/dist/cjs/src/classes/index.js +17 -0
- package/dist/cjs/src/classes/internal.js +19 -0
- package/dist/cjs/src/decorators/ErrorPath.internal/functions.js +5 -5
- package/dist/cjs/src/decorators/HappyPath.internal/functions.js +5 -5
- package/dist/cjs/src/decorators/Risky.internal/functions.js +5 -7
- package/dist/cjs/src/decorators/Risky.js +2 -0
- package/dist/cjs/src/decorators/RiskyPath.js +2 -0
- package/dist/esm/index.d.ts +1 -3
- package/dist/esm/index.js +1 -3
- package/dist/esm/src/classes/Fail.d.ts +1 -1
- package/dist/esm/src/classes/Fail.js +1 -1
- package/dist/esm/src/classes/Success.d.ts +1 -1
- package/dist/esm/src/classes/Success.js +1 -1
- package/dist/esm/src/classes/abstracts/ATresult.d.ts +12 -0
- package/dist/esm/src/classes/abstracts/ATresult.js +17 -0
- package/dist/esm/src/classes/index.d.ts +1 -0
- package/dist/esm/src/classes/index.js +1 -0
- package/dist/esm/src/classes/internal.d.ts +3 -0
- package/dist/esm/src/classes/internal.js +3 -0
- package/dist/esm/src/decorators/ErrorPath.internal/functions.js +1 -1
- package/dist/esm/src/decorators/HappyPath.internal/functions.js +1 -1
- package/dist/esm/src/decorators/Risky.d.ts +1 -1
- package/dist/esm/src/decorators/Risky.internal/functions.d.ts +1 -1
- package/dist/esm/src/decorators/Risky.internal/functions.js +1 -3
- package/dist/esm/src/decorators/Risky.js +2 -0
- package/dist/esm/src/decorators/RiskyPath.js +2 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -14,17 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Result = void 0;
|
|
17
|
+
exports.Result = exports.Success = exports.Fail = void 0;
|
|
18
18
|
// Décorateurs (API Publique principale)
|
|
19
19
|
__exportStar(require("./src/decorators/Risky"), exports);
|
|
20
20
|
__exportStar(require("./src/decorators/RiskyPath"), exports);
|
|
21
21
|
__exportStar(require("./src/decorators/HappyPath"), exports);
|
|
22
22
|
__exportStar(require("./src/decorators/ErrorPath"), exports);
|
|
23
23
|
// Classes & Abstractions (Pour le typage et création manuelle)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return
|
|
24
|
+
var classes_1 = require("./src/classes");
|
|
25
|
+
Object.defineProperty(exports, "Fail", { enumerable: true, get: function () { return classes_1.Fail; } });
|
|
26
|
+
Object.defineProperty(exports, "Success", { enumerable: true, get: function () { return classes_1.Success; } });
|
|
27
|
+
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return classes_1.ATresult; } });
|
|
28
28
|
// Types (Pour l'IntelliSense)
|
|
29
29
|
__exportStar(require("./src/types/resultsCallbacks"), exports);
|
|
30
30
|
__exportStar(require("./src/types/ResultMatch"), exports);
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.Fail = void 0;
|
|
6
6
|
const ITResult_1 = require("../interfaces/ITResult");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("./internal");
|
|
8
8
|
/**
|
|
9
9
|
* Class representing a failed result.
|
|
10
10
|
* @template TSuccess - The type of the success value.
|
|
11
11
|
* @template TE - The type of the error value (default is Error).
|
|
12
12
|
*/
|
|
13
|
-
class Fail extends
|
|
13
|
+
class Fail extends internal_1.ATresult {
|
|
14
14
|
/**
|
|
15
15
|
* Creates an instance of Fail.
|
|
16
16
|
* @param error The error value.
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.Success = void 0;
|
|
6
6
|
const ITResult_1 = require("../interfaces/ITResult");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("./internal");
|
|
8
8
|
/**
|
|
9
9
|
* Class representing a successful result.
|
|
10
10
|
* @template TSuccess - The type of the success value.
|
|
11
11
|
* @template TE - The type of the error value (default is Error).
|
|
12
12
|
*/
|
|
13
|
-
class Success extends
|
|
13
|
+
class Success extends internal_1.ATresult {
|
|
14
14
|
/**
|
|
15
15
|
* Creates an instance of Success.
|
|
16
16
|
* @param value The success value.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.ATresult = void 0;
|
|
6
6
|
const ITResult_1 = require("../../interfaces/ITResult");
|
|
7
|
+
const internal_1 = require("../internal");
|
|
7
8
|
/**
|
|
8
9
|
* Abstract class representing a result that can be either a success or an error.
|
|
9
10
|
*/
|
|
@@ -24,5 +25,21 @@ class ATresult {
|
|
|
24
25
|
isError() {
|
|
25
26
|
return this.state() === ITResult_1.ResultState.Error;
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new Success result.
|
|
30
|
+
* @param value Optional success value.
|
|
31
|
+
* @returns A new Success instance containing the value.
|
|
32
|
+
*/
|
|
33
|
+
static Ok(value) {
|
|
34
|
+
return internal_1.Success.Create(value);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new Fail result.
|
|
38
|
+
* @param error Optional error value.
|
|
39
|
+
* @returns A new Fail instance containing the error.
|
|
40
|
+
*/
|
|
41
|
+
static Fail(error) {
|
|
42
|
+
return internal_1.Fail.Create(error ?? new Error("An error occurred"));
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
exports.ATresult = ATresult;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./internal"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./abstracts/ATresult"), exports);
|
|
18
|
+
__exportStar(require("./Success"), exports);
|
|
19
|
+
__exportStar(require("./Fail"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
//type: functions
|
|
3
|
+
//description: Functions to handle error path operations by executing a callback on errored results.
|
|
2
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
5
|
exports.errorPathSync = errorPathSync;
|
|
4
6
|
exports.errorPathAsync = errorPathAsync;
|
|
5
|
-
|
|
6
|
-
//description: Functions to handle error path operations by executing a callback on errored results.
|
|
7
|
-
const ATresult_1 = require("../../classes/abstracts/ATresult");
|
|
7
|
+
const classes_1 = require("../../classes");
|
|
8
8
|
/**
|
|
9
9
|
* Handles the error path for synchronous functions by executing a callback on errored results.
|
|
10
10
|
* @param this The context in which the original function is called.
|
|
@@ -15,7 +15,7 @@ const ATresult_1 = require("../../classes/abstracts/ATresult");
|
|
|
15
15
|
*/
|
|
16
16
|
function errorPathSync(original, path, ...args) {
|
|
17
17
|
const result = original.call(this, ...args);
|
|
18
|
-
if (result instanceof
|
|
18
|
+
if (result instanceof classes_1.ATresult) {
|
|
19
19
|
return result.match({
|
|
20
20
|
Ok: (_) => result,
|
|
21
21
|
Err: (val) => val,
|
|
@@ -33,7 +33,7 @@ function errorPathSync(original, path, ...args) {
|
|
|
33
33
|
*/
|
|
34
34
|
async function errorPathAsync(original, path, ...args) {
|
|
35
35
|
const result = await original.call(this, ...args);
|
|
36
|
-
if (result instanceof
|
|
36
|
+
if (result instanceof classes_1.ATresult) {
|
|
37
37
|
return result.match({
|
|
38
38
|
Ok: (_) => result,
|
|
39
39
|
Err: (val) => val,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
//type: functions
|
|
3
|
+
//description: Functions to handle happy path operations by executing a callback on successful results.
|
|
2
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
5
|
exports.happyPathSync = happyPathSync;
|
|
4
6
|
exports.happyPathASync = happyPathASync;
|
|
5
|
-
|
|
6
|
-
//description: Functions to handle happy path operations by executing a callback on successful results.
|
|
7
|
-
const ATresult_1 = require("../../classes/abstracts/ATresult");
|
|
7
|
+
const classes_1 = require("../../classes");
|
|
8
8
|
/**
|
|
9
9
|
* Handles the happy path for synchronous functions by executing a callback on successful results.
|
|
10
10
|
* @param this The context in which the original function is called.
|
|
@@ -15,7 +15,7 @@ const ATresult_1 = require("../../classes/abstracts/ATresult");
|
|
|
15
15
|
*/
|
|
16
16
|
function happyPathSync(original, path, ...args) {
|
|
17
17
|
const result = original.call(this, ...args);
|
|
18
|
-
if (result instanceof
|
|
18
|
+
if (result instanceof classes_1.ATresult) {
|
|
19
19
|
return result.match({
|
|
20
20
|
Ok: (val) => path(val),
|
|
21
21
|
Err: (e) => result
|
|
@@ -33,7 +33,7 @@ function happyPathSync(original, path, ...args) {
|
|
|
33
33
|
*/
|
|
34
34
|
async function happyPathASync(original, path, ...args) {
|
|
35
35
|
const result = await original.call(this, ...args);
|
|
36
|
-
if (result instanceof
|
|
36
|
+
if (result instanceof classes_1.ATresult) {
|
|
37
37
|
return result.match({
|
|
38
38
|
Ok: (val) => path(val),
|
|
39
39
|
Err: (e) => result
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.riskySync = riskySync;
|
|
6
6
|
exports.riskyAsync = riskyAsync;
|
|
7
|
-
const
|
|
8
|
-
const Fail_1 = require("../../classes/Fail");
|
|
9
|
-
const Success_1 = require("../../classes/Success");
|
|
7
|
+
const classes_1 = require("../../classes");
|
|
10
8
|
/**
|
|
11
9
|
* Handles synchronous risky operations by converting exceptions into Result types.
|
|
12
10
|
* @param this The context in which the original function is called.
|
|
@@ -17,10 +15,10 @@ const Success_1 = require("../../classes/Success");
|
|
|
17
15
|
function riskySync(original, ...args) {
|
|
18
16
|
try {
|
|
19
17
|
const result = original.apply(this, args);
|
|
20
|
-
return result instanceof
|
|
18
|
+
return result instanceof classes_1.ATresult ? result : classes_1.Success.Create(result);
|
|
21
19
|
}
|
|
22
20
|
catch (error) {
|
|
23
|
-
return error instanceof
|
|
21
|
+
return error instanceof classes_1.ATresult ? error : classes_1.Fail.Create(error);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
@@ -33,9 +31,9 @@ function riskySync(original, ...args) {
|
|
|
33
31
|
async function riskyAsync(original, ...args) {
|
|
34
32
|
try {
|
|
35
33
|
const result = await original.apply(this, args);
|
|
36
|
-
return result instanceof
|
|
34
|
+
return result instanceof classes_1.ATresult ? result : classes_1.Success.Create(result);
|
|
37
35
|
}
|
|
38
36
|
catch (error) {
|
|
39
|
-
return error instanceof
|
|
37
|
+
return error instanceof classes_1.ATresult ? error : classes_1.Fail.Create(error);
|
|
40
38
|
}
|
|
41
39
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// type: decorators
|
|
3
|
+
// description: Decorators to handle risky operations by converting exceptions into Result types.
|
|
2
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
5
|
exports.RiskyPath = RiskyPath;
|
|
4
6
|
exports.RiskyPathAsync = RiskyPathAsync;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ export * from './src/decorators/Risky';
|
|
|
2
2
|
export * from './src/decorators/RiskyPath';
|
|
3
3
|
export * from './src/decorators/HappyPath';
|
|
4
4
|
export * from './src/decorators/ErrorPath';
|
|
5
|
-
export
|
|
6
|
-
export * from './src/classes/Success';
|
|
7
|
-
export { ATresult as Result } from './src/classes/abstracts/ATresult';
|
|
5
|
+
export { Fail, Success, ATresult as Result } from './src/classes';
|
|
8
6
|
export * from './src/types/resultsCallbacks';
|
|
9
7
|
export * from './src/types/ResultMatch';
|
package/dist/esm/index.js
CHANGED
|
@@ -4,9 +4,7 @@ export * from './src/decorators/RiskyPath';
|
|
|
4
4
|
export * from './src/decorators/HappyPath';
|
|
5
5
|
export * from './src/decorators/ErrorPath';
|
|
6
6
|
// Classes & Abstractions (Pour le typage et création manuelle)
|
|
7
|
-
export
|
|
8
|
-
export * from './src/classes/Success';
|
|
9
|
-
export { ATresult as Result } from './src/classes/abstracts/ATresult';
|
|
7
|
+
export { Fail, Success, ATresult as Result } from './src/classes';
|
|
10
8
|
// Types (Pour l'IntelliSense)
|
|
11
9
|
export * from './src/types/resultsCallbacks';
|
|
12
10
|
export * from './src/types/ResultMatch';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResultState, ITResult } from "../interfaces/ITResult";
|
|
2
2
|
import { ResultMatch } from "../types/ResultMatch";
|
|
3
3
|
import { ChainedCallback, SuccessMapCallback, ErrorMapCallback } from "../types/resultsCallbacks";
|
|
4
|
-
import { ATresult } from "./
|
|
4
|
+
import { ATresult } from "./internal";
|
|
5
5
|
/**
|
|
6
6
|
* Class representing a failed result.
|
|
7
7
|
* @template TSuccess - The type of the success value.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// type: class
|
|
2
2
|
// description: Class representing a error result.
|
|
3
3
|
import { ResultState } from "../interfaces/ITResult";
|
|
4
|
-
import { ATresult } from "./
|
|
4
|
+
import { ATresult } from "./internal";
|
|
5
5
|
/**
|
|
6
6
|
* Class representing a failed result.
|
|
7
7
|
* @template TSuccess - The type of the success value.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResultState, ITResult } from "../interfaces/ITResult";
|
|
2
2
|
import { ResultMatch } from "../types/ResultMatch";
|
|
3
3
|
import { ChainedCallback, SuccessMapCallback, ErrorMapCallback } from "../types/resultsCallbacks";
|
|
4
|
-
import { ATresult } from "./
|
|
4
|
+
import { ATresult } from "./internal";
|
|
5
5
|
/**
|
|
6
6
|
* Class representing a successful result.
|
|
7
7
|
* @template TSuccess - The type of the success value.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// type: class
|
|
2
2
|
// description: Class representing a successful result.
|
|
3
3
|
import { ResultState } from "../interfaces/ITResult";
|
|
4
|
-
import { ATresult } from "./
|
|
4
|
+
import { ATresult } from "./internal";
|
|
5
5
|
/**
|
|
6
6
|
* Class representing a successful result.
|
|
7
7
|
* @template TSuccess - The type of the success value.
|
|
@@ -63,4 +63,16 @@ export declare abstract class ATresult<Success, E = Error> implements ITResult<S
|
|
|
63
63
|
* @returns True if the result is an error, false otherwise.
|
|
64
64
|
*/
|
|
65
65
|
isError(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Creates a new Success result.
|
|
68
|
+
* @param value Optional success value.
|
|
69
|
+
* @returns A new Success instance containing the value.
|
|
70
|
+
*/
|
|
71
|
+
static Ok<TSuccess, TE = Error>(value?: TSuccess): ITResult<TSuccess, TE>;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a new Fail result.
|
|
74
|
+
* @param error Optional error value.
|
|
75
|
+
* @returns A new Fail instance containing the error.
|
|
76
|
+
*/
|
|
77
|
+
static Fail<TSuccess, TE = Error>(error?: TE): ITResult<TSuccess, TE>;
|
|
66
78
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// type: class
|
|
2
2
|
// description: Abstract class implementing the ITResult interface.
|
|
3
3
|
import { ResultState } from "../../interfaces/ITResult";
|
|
4
|
+
import { Fail, Success } from "../internal";
|
|
4
5
|
/**
|
|
5
6
|
* Abstract class representing a result that can be either a success or an error.
|
|
6
7
|
*/
|
|
@@ -21,4 +22,20 @@ export class ATresult {
|
|
|
21
22
|
isError() {
|
|
22
23
|
return this.state() === ResultState.Error;
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new Success result.
|
|
27
|
+
* @param value Optional success value.
|
|
28
|
+
* @returns A new Success instance containing the value.
|
|
29
|
+
*/
|
|
30
|
+
static Ok(value) {
|
|
31
|
+
return Success.Create(value);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new Fail result.
|
|
35
|
+
* @param error Optional error value.
|
|
36
|
+
* @returns A new Fail instance containing the error.
|
|
37
|
+
*/
|
|
38
|
+
static Fail(error) {
|
|
39
|
+
return Fail.Create(error ?? new Error("An error occurred"));
|
|
40
|
+
}
|
|
24
41
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './internal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './internal';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//type: functions
|
|
2
2
|
//description: Functions to handle error path operations by executing a callback on errored results.
|
|
3
|
-
import { ATresult } from "../../classes
|
|
3
|
+
import { ATresult } from "../../classes";
|
|
4
4
|
/**
|
|
5
5
|
* Handles the error path for synchronous functions by executing a callback on errored results.
|
|
6
6
|
* @param this The context in which the original function is called.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//type: functions
|
|
2
2
|
//description: Functions to handle happy path operations by executing a callback on successful results.
|
|
3
|
-
import { ATresult } from "../../classes
|
|
3
|
+
import { ATresult } from "../../classes";
|
|
4
4
|
/**
|
|
5
5
|
* Handles the happy path for synchronous functions by executing a callback on successful results.
|
|
6
6
|
* @param this The context in which the original function is called.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ATresult } from "../classes
|
|
1
|
+
import { ATresult } from "../classes";
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to handle risky operations by converting exceptions into Result types.
|
|
4
4
|
* @returns A method decorator that wraps the original method with error handling.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// type: functions
|
|
2
2
|
// description: Functions to handle risky operations by converting exceptions into Result types.
|
|
3
|
-
import { ATresult } from "../../classes
|
|
4
|
-
import { Fail } from "../../classes/Fail";
|
|
5
|
-
import { Success } from "../../classes/Success";
|
|
3
|
+
import { ATresult, Fail, Success } from "../../classes";
|
|
6
4
|
/**
|
|
7
5
|
* Handles synchronous risky operations by converting exceptions into Result types.
|
|
8
6
|
* @param this The context in which the original function is called.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// type: decorators
|
|
2
|
+
// description: Decorators to handle risky operations by converting exceptions into Result types.
|
|
1
3
|
import { riskyAsync, riskySync } from "./Risky.internal/functions";
|
|
2
4
|
/**
|
|
3
5
|
* Decorator to handle risky operations by converting exceptions into Result types.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// type: decorators
|
|
2
|
+
// description: Decorators to handle risky operations by converting exceptions into Result types.
|
|
1
3
|
import { riskyAsync, riskySync } from "./Risky.internal/functions";
|
|
2
4
|
/**
|
|
3
5
|
* Decorator to handle risky operations by converting exceptions into Result types.
|