@riim/fn-utils 0.1.0 → 0.1.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/fnUtils.js +2 -2
- package/dist/throwIt.d.ts +1 -1
- package/package.json +1 -1
package/dist/fnUtils.js
CHANGED
|
@@ -100,8 +100,8 @@ function propOr(name, defaultValue) {
|
|
|
100
100
|
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/throwIt.ts
|
|
103
|
-
function throwIt(err) {
|
|
104
|
-
throw err;
|
|
103
|
+
function throwIt(err, ctor) {
|
|
104
|
+
throw err instanceof Error || ctor === null ? err : new (ctor ?? Error)(err);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
//#endregion
|
package/dist/throwIt.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function throwIt(err: any):
|
|
1
|
+
export declare function throwIt(err: any, ctor?: typeof Error | null): any;
|