@zokugun/cli-utils 0.4.3 → 0.4.5

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.
@@ -5,5 +5,13 @@ type LimitedResult<T, E> = {
5
5
  fails: false;
6
6
  value: T;
7
7
  };
8
- export declare function unwrapFatal<T, E>(result: LimitedResult<T, E>): T;
9
- export {};
8
+ declare function unwrapFatal<E>(result: {
9
+ error: E;
10
+ fails: true;
11
+ }): never;
12
+ declare function unwrapFatal<T>(result: {
13
+ fails: false;
14
+ value: T;
15
+ }): T;
16
+ declare function unwrapFatal<T, E>(result: LimitedResult<T, E>): T;
17
+ export { unwrapFatal };
@@ -5,5 +5,13 @@ type LimitedResult<T, E> = {
5
5
  fails: false;
6
6
  value: T;
7
7
  };
8
- export declare function unwrapFatal<T, E>(result: LimitedResult<T, E>): T;
9
- export {};
8
+ declare function unwrapFatal<E>(result: {
9
+ error: E;
10
+ fails: true;
11
+ }): never;
12
+ declare function unwrapFatal<T>(result: {
13
+ fails: false;
14
+ value: T;
15
+ }): T;
16
+ declare function unwrapFatal<T, E>(result: LimitedResult<T, E>): T;
17
+ export { unwrapFatal };
@@ -1,8 +1,9 @@
1
1
  import * as xtry from '@zokugun/xtry';
2
2
  import logger from './logger.mjs';
3
- export function unwrapFatal(result) {
3
+ function unwrapFatal(result) {
4
4
  if (result.fails) {
5
5
  return logger.fatal(xtry?.stringifyError(result.error) ?? String(result.error));
6
6
  }
7
7
  return result.value;
8
8
  }
9
+ export { unwrapFatal };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zokugun/cli-utils",
3
3
  "description": "Utils for CLI app",
4
- "version": "0.4.3",
4
+ "version": "0.4.5",
5
5
  "author": {
6
6
  "name": "Baptiste Augrain",
7
7
  "email": "daiyam@zokugun.org"
@@ -90,7 +90,7 @@
90
90
  "clean": "rimraf lib .src",
91
91
  "compile:src": "tsc -p src",
92
92
  "lint": "eslint",
93
- "lint:all": "npm run lint:package && npm audit && npm run ci:lint",
93
+ "lint:all": "npm run lint:package && npm run ci:lint",
94
94
  "lint:fix": "eslint --fix",
95
95
  "lint:package": "fixpack || true",
96
96
  "prepack": "npm run build",
@@ -104,7 +104,7 @@
104
104
  },
105
105
  "dependencies": {
106
106
  "@commander-js/extra-typings": "14.0.0",
107
- "@zokugun/exec-lite": "0.3.0",
107
+ "@zokugun/exec-lite": "0.4.0",
108
108
  "@zokugun/log-update-plus": "0.1.1",
109
109
  "ansi-colors": "4.1.3",
110
110
  "cli-spinners": "3.4.0",