@praha/byethrow 0.6.1 → 0.6.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.
@@ -38,7 +38,7 @@ const unwrapError = (...args)=>{
38
38
  const apply = (r)=>{
39
39
  if ((0, external_is_success_cjs_namespaceObject.isSuccess)(r)) {
40
40
  if (hasDefault) return defaultValue;
41
- throw new Error(String(r.value));
41
+ throw r.value;
42
42
  }
43
43
  return r.error;
44
44
  };
@@ -50,7 +50,7 @@ const unwrapError = (...args)=>{
50
50
  const apply = (r)=>{
51
51
  if ((0, external_is_success_cjs_namespaceObject.isSuccess)(r)) {
52
52
  if (hasDefault) return defaultValue;
53
- throw new Error(String(r.value));
53
+ throw r.value;
54
54
  }
55
55
  return r.error;
56
56
  };
@@ -38,7 +38,7 @@ const unwrap = (...args)=>{
38
38
  const apply = (r)=>{
39
39
  if ((0, external_is_failure_cjs_namespaceObject.isFailure)(r)) {
40
40
  if (hasDefault) return defaultValue;
41
- throw new Error(String(r.error));
41
+ throw r.error;
42
42
  }
43
43
  return r.value;
44
44
  };
@@ -50,7 +50,7 @@ const unwrap = (...args)=>{
50
50
  const apply = (r)=>{
51
51
  if ((0, external_is_failure_cjs_namespaceObject.isFailure)(r)) {
52
52
  if (hasDefault) return defaultValue;
53
- throw new Error(String(r.error));
53
+ throw r.error;
54
54
  }
55
55
  return r.value;
56
56
  };
@@ -10,7 +10,7 @@ const unwrapError = (...args)=>{
10
10
  const apply = (r)=>{
11
11
  if (isSuccess(r)) {
12
12
  if (hasDefault) return defaultValue;
13
- throw new Error(String(r.value));
13
+ throw r.value;
14
14
  }
15
15
  return r.error;
16
16
  };
@@ -22,7 +22,7 @@ const unwrapError = (...args)=>{
22
22
  const apply = (r)=>{
23
23
  if (isSuccess(r)) {
24
24
  if (hasDefault) return defaultValue;
25
- throw new Error(String(r.value));
25
+ throw r.value;
26
26
  }
27
27
  return r.error;
28
28
  };
@@ -10,7 +10,7 @@ const unwrap = (...args)=>{
10
10
  const apply = (r)=>{
11
11
  if (isFailure(r)) {
12
12
  if (hasDefault) return defaultValue;
13
- throw new Error(String(r.error));
13
+ throw r.error;
14
14
  }
15
15
  return r.value;
16
16
  };
@@ -22,7 +22,7 @@ const unwrap = (...args)=>{
22
22
  const apply = (r)=>{
23
23
  if (isFailure(r)) {
24
24
  if (hasDefault) return defaultValue;
25
- throw new Error(String(r.error));
25
+ throw r.error;
26
26
  }
27
27
  return r.value;
28
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praha/byethrow",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "A lightweight, tree-shakable Result type package with a simple, consistent API designed",
5
5
  "keywords": [
6
6
  "javascript",