@travetto/cli 2.2.3 → 2.2.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@travetto/cli",
3
3
  "displayName": "Command Line Interface",
4
- "version": "2.2.3",
4
+ "version": "2.2.4",
5
5
  "description": "CLI infrastructure for travetto framework",
6
6
  "keywords": [
7
7
  "cli",
@@ -27,7 +27,7 @@
27
27
  "directory": "module/cli"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/base": "^2.2.3",
30
+ "@travetto/base": "^2.2.4",
31
31
  "commander": "^9.4.0"
32
32
  },
33
33
  "docDependencies": {
package/src/command.ts CHANGED
@@ -87,7 +87,7 @@ export abstract class CliCommand<V extends OptionMap = OptionMap> {
87
87
  * Define option
88
88
  */
89
89
  option<K extends OptionPrimitive, T extends OptionConfig<K>>(cfg: T): T {
90
- if ('combine' in cfg && cfg.combine && cfg.def && !Array.isArray(cfg.def)) {
90
+ if ('combine' in cfg && cfg.combine && cfg.def !== undefined && !Array.isArray(cfg.def)) {
91
91
  cfg.def = cfg.combine(`${cfg.def}`, cfg.def);
92
92
  }
93
93
  return { type: String, ...cfg };
package/src/util.ts CHANGED
@@ -18,7 +18,7 @@ export class CliUtil {
18
18
  static toBool(x: string | boolean, def: boolean): boolean;
19
19
  static toBool(x?: string | boolean, def?: boolean): boolean | undefined;
20
20
  static toBool(x?: string | boolean, def?: boolean): boolean | undefined {
21
- return x === undefined ? true :
21
+ return x === undefined ? def :
22
22
  (typeof x === 'boolean' ? x :
23
23
  (this.isBoolean(x) ? /^(1|yes|on|true)$/i.test(x) :
24
24
  def));