klubok 0.2.1 → 0.2.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.
- package/dist/index.js +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -18,10 +18,10 @@ function klubok(...fns) {
|
|
18
18
|
return await Promise.resolve(fn(ctx)).then(resp => ({ ...ctx, [fn.key]: resp }));
|
19
19
|
}
|
20
20
|
catch (error) {
|
21
|
-
|
22
|
-
error
|
23
|
-
|
24
|
-
|
21
|
+
if (error instanceof Error) {
|
22
|
+
error.stack += '\ncontext: ' + (0, node_util_1.inspect)(ctx);
|
23
|
+
}
|
24
|
+
throw error;
|
25
25
|
}
|
26
26
|
})())
|
27
27
|
: (acc, fn) => acc.then(ctx => !fn.mutable && Reflect.has(ctx, fn.key) && !Reflect.has(mock ?? {}, fn.key)
|
@@ -36,10 +36,10 @@ function klubok(...fns) {
|
|
36
36
|
: fn(ctx)).then(resp => ({ ...ctx, [fn.key]: resp }));
|
37
37
|
}
|
38
38
|
catch (error) {
|
39
|
-
|
40
|
-
error
|
41
|
-
|
42
|
-
|
39
|
+
if (error instanceof Error) {
|
40
|
+
error.stack += '\ncontext: ' + (0, node_util_1.inspect)(ctx);
|
41
|
+
}
|
42
|
+
throw error;
|
43
43
|
}
|
44
44
|
})()), Promise.resolve({ ...rootCtx, ...mock }));
|
45
45
|
}
|