@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 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): unknown;
1
+ export declare function throwIt(err: any, ctor?: typeof Error | null): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riim/fn-utils",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/Riim/fnUtils#readme",
6
6
  "bugs": {