klubok 0.5.1 → 0.5.3
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.md +1 -1
- package/dist/index.js +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Do notation pipes for Promise-based or pure functions which easy to mock <br/>
|
|
6
6
|
Inspired by fp-ts/Effect `bind` Do-notation, but much more small and simple <br/>
|
|
7
|
-
Primarly created for easy mocking of functions, which allows to write tons of unit tests
|
|
7
|
+
Primarly created for easy mocking of functions, which allows to write tons of unit tests using London school approach
|
|
8
8
|
|
|
9
9
|
## Example
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,7 @@ function klubok(...fns) {
|
|
|
45
45
|
}
|
|
46
46
|
catch (error) {
|
|
47
47
|
await onError?.({ ...ctx, $error: error });
|
|
48
|
-
if (error instanceof Error) {
|
|
48
|
+
if (error instanceof Error && !error.isApproved) {
|
|
49
49
|
error.stack += '\ncontext: ' + (0, node_util_1.inspect)(ctx);
|
|
50
50
|
}
|
|
51
51
|
throw error;
|
|
@@ -69,7 +69,7 @@ function klubok(...fns) {
|
|
|
69
69
|
}
|
|
70
70
|
catch (error) {
|
|
71
71
|
await onError?.({ ...ctx, $error: error });
|
|
72
|
-
if (error instanceof Error) {
|
|
72
|
+
if (error instanceof Error && !error.isApproved) {
|
|
73
73
|
error.stack += '\ncontext: ' + (0, node_util_1.inspect)(ctx);
|
|
74
74
|
}
|
|
75
75
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "klubok",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Do notation pipes for Promise-based or pure functions which easy to mock",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"author": "Vladislav Botvin",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^24.1
|
|
38
|
-
"klubok": "0.5.
|
|
39
|
-
"tinybench": "^
|
|
40
|
-
"tsd": "^0.
|
|
41
|
-
"typescript": "^5.
|
|
37
|
+
"@types/node": "^24.9.1",
|
|
38
|
+
"klubok": "0.5.2",
|
|
39
|
+
"tinybench": "^5.0.1",
|
|
40
|
+
"tsd": "^0.33.0",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
42
|
}
|
|
43
43
|
}
|